"David A. Greene" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: > >>>Your correction above makes everything clear to me now. >> So do you feel you need an additional library feature? ;-) > > I suppose not. What I really wanted was the ability to take a > regular old template class and create a generator out of it: > > template<typename T, typename U, typename V> > struct my_type { ... } // Note: no ::type member > > typedef SHAZAM<my_type<int, _1, _2> > generator; > > typedef generator::template apply<char, float>::type my_type_inst; > > I want SHAZAM to be generic enough to take any template class, > not just my_type.
You can do that, up to N arguments, for some N. > If I understand your solution correctly, > it requires a manually-constructed generator for my_type: > > template<typename T, typename U, typename V> > struct my_type_generator { > typedef my_type<T, U, V> type; > }; > > SHAZAM then becomes mpl::lambda. > > The problem is, I'll have to create these trivial "generators" > (I hesitate to even call it that) many times over, once for each > class I want to bind. > > But I can construct a generic trivial generator: > > template<template<typename A, typename B, typename C> class Base, > typename T, typename U, typename V> > struct trivial_generator { > typedef Base<T, U, V> type; > }; > > Then I can use MPL lambda facilities. Unfortunately, I need a > trivial_generator for every arity of class template. Only as part of the implementation. You just need a nice wrapper over the top to hide it all. -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost