First of all there are several glitches here: > template <typename _T1, int _Name1, typename _T2, int _Name2> > class named_pair{ > public: > template <int _Name> > class var{}; > template<>? > class var<_Name1>{
I am not sure that you allowed to use template parameter for defining partial specialization. > public: > _T1 value; > } ;? > template<>? > class var<_Name2>{ public: > _T2 value; > } ;? > }; > > enum{ Cash, Name }; > > void main(int argc, char *argv[]){ > named_pair<float, Cash, char*, Name> foobar; > > foobar.var<Cash>.value = 32.2; > foobar.var<Name>.value = "Fred"; Even if above class definition is allowed foobar.var<Cash> will be invalud cause var<Cash> is a type name. So basically what you are doing is unusable. > } Look on MPL example for inherit_linear. It may have what you need. Gennadiy. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost