class template as a type

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Fri Sep 21 06:28:50 PDT 2007


Karl wrote:
> Chris Nicholson-Sauls Wrote:
> 
>> Jarrett Billingsley wrote:
>>> "Frits van Bommel" <fvbommel at REMwOVExCAPSs.nl> wrote in message 
>>> news:fct4r0$hl9$1 at digitalmars.com...
>>>> Yes I did. I'm not quite sure how I managed to typo 'class' to 'function' 
>>>> though...
>>> It's understandable.  The keys are right next to each other. 
>>>
>>>
>> You have a [class] key on your keyboard!?  ...is that thing available on Amazon?
>>
>> -- Chris Nicholson-Sauls
> 
> Hehehehe. Guys, back into the subject. The only problem implementing a base class is that anyone can create a custom class inherited from the base class, override methods, skip all the base class constructors and then add it to an array or pass it to a function. Then there seems to be no way to check if this custom class implements the class template.

So you make the constructor(s) private and then only classes in the same 
module can inherit from it.


More information about the Digitalmars-d-learn mailing list