Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2003-01-10 03:28:36


On Fri, 10 Jan 2003 05:05:17 +0100, David Abrahams wrote:

> Daniel Frey <d.frey_at_[hidden]> 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.

After reading some docs of the MPL, I found out that it tries to mimic the
STL. The question is, whether this is appropriate for this domain, but I
will have to think about this much longer before I can say anything useful
:)

Anyway, the MPL looks really promissing as it is now, I think it will be a
very useful library. Congratulations to the authors.

Regards, Daniel


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