[Issue 1462] Templated constructor not supported

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Sep 11 06:06:12 PDT 2008


On Thu, Sep 11, 2008 at 5:53 AM, Bruno Medeiros
<brunodomedeiros+spam at com.gmail> wrote:
> 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.

Then beat Walter over the head!


More information about the Digitalmars-d-bugs mailing list