Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2003-01-09 18:35:57


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 );

OK, this is just a quick thought. Sorry if it was discussed before, I'm
just too lazy to search for it now... :))

Regards, Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk