[Issue 1462] Templated constructor not supported

Bruno Medeiros brunodomedeiros+spam at com.gmail
Thu Sep 11 02:53:57 PDT 2008


Jarrett Billingsley wrote:
> On Tue, Sep 9, 2008 at 3:55 PM, Sean Kelly <sean at invisibleduck.org> wrote:
>> Jarrett Billingsley wrote:
>>> I think it's much more that templated methods cannot be virtual, and
>>> constructors more or less have to be.
>> How are constructors virtual?
> 
> Uhh umm
> 
> Well as it is now, constructors are treated as methods of the class,
> so they participate in overloading.  But I think you're right - it
> doesn't really seem to have to be that way.

That makes no sense :p . Not only are they not virtual, they could never 
be virtual. Virtual method dispatch is used when you have polymorphism 
and don't know the exact class of the receiving object. But when 
constructing you always know the exact class being creating, so you 
would always know which method/constructor/whatever to dispatch to.


-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D


More information about the Digitalmars-d-bugs mailing list