David B. Held wrote: > > > > template <class Policy> > > > > struct get_category > > > > : mpl::if_< > > > > mpl::is_placeholder<Policy> > > > > , mpl::identity<Policy> > > > > , get_category_impl<Policy> > > > > >::type > > > > { > > > > BOOST_MPL_AUX_LAMBDA_SUPPORT(1,get_category,(Policy)) > > > > }; > > [...] > > When is it better to derive from something vs. composing it > in a typedef?
It's mostly the matter of style. Typedef is inherently more verbose: template <class Policy> struct get_category { typedef typename mpl::if_< mpl::is_placeholder<Policy> , mpl::identity<Policy> , get_category_impl<Policy> >::type::type type; BOOST_MPL_AUX_LAMBDA_SUPPORT(1,get_category,(Policy)) }; There are also cases when inheritance is preferable because it brings along other base class' members, besides the canonical 'type' typedef: // enables both 'is_same<...>::value' and 'is_same<...>::type' // notations template< typename T1, typename T2 > struct is_same : bool_c<false> { }; > Also, we're really close on the smart pointer code. I've > checked in the latest version to the sandbox, applying your changes. > However, I still get 14 errors that are all in mpl/identity.hpp. No wonder - you are including MPL headers inside the opened 'boost' namespace (line 194) ;). [...] > BOOST_MPL_AUX_VOID_SPEC(1, identity) > BOOST_MPL_AUX_VOID_SPEC(1, make_identity) > > Now, I notice that I'm supposed to define these for the policies under > bcc. That's an oversight. I am planning to fix it shortly so BOOST_MPL_AUX_LAMBDA_SUPPORT will be self-sufficient. HTH, Aleksey _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost