From: Grzegorz J. <ja...@he...> - 2003-06-03 21:24:12
|
On Fri, 16 May 2003, Bing-Chang Lai wrote: > Hi! > > I was wondering how to define a metaclass for a template. At the moment OpenC++ has a feature that allows you to define the metaclass for a template, just as you would for an ordinary class. You can check if a metaobject represents class or class template by using 'AcceptTemplate()' member function. However, please have in mind, that the latest release does not have full support for templates, in particular it does not instantiate templates and there is no way to have metaobjects of template specializations. Best regards Grzegorz > > So say the Person class used in the tutorial is now a templated class, > as follows: > > template<typename ageT> class Person { > public: > Person(ageT age); > ageT Age() { return age; } > ageT BirthdayComes() { return ++age; } > private: > ageT age; > }; > > What would the original "metaclass VerboseClass Person;" become? > > Thanks. > > Regards, > Bing-Chang Lai > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |