class template as a type

Karl asdf at asdf.com
Fri Sep 21 22:37:30 PDT 2007


Frits van Bommel Wrote:

> 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.

WOW. Great idea, cool man, thanks for everything.
That surely will work, i don't know why i didn't think about that before...i guess i'm not smart enough.


More information about the Digitalmars-d-learn mailing list