Daniel Frey <[EMAIL PROTECTED]> writes: > On Thu, 09 Jan 2003 19:28:17 +0100, David Abrahams wrote: > >> typedef mpl::vector<bool,int,double,string> legal_types; >> BOOST_STATIC_ASSERT((mpl::contains<legal_types,T>::value)); > > Now that's elegant! I think I should have a look at the MPL soon :)) > One question: 'contains' seems to have the problem that it's not very > obvious whether it takes the 'vector' as first or second argument. > > Is it possible to add a "member function" like this: > > typedef mpl::vector< bool, int, double, std::string > legal_types; > BOOST_STATIC_ASSERT( legal_types::contains< T >::value );
Possible but not desirable, IMO. Contains is a generalized sequence algorithm like std::find. -- 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