Just an addition to the second question...
Unfortunately, I forgot my MPL book at work :(
But I remember, that in the chapter about physical quantities authors show
how to compare quantity types (one which is iniaital mpl::vector like
mpl::vector_c and the other an instance of mpl::vector
which is produced as a result of function application (which logically also
results in the same template arguments but have different type)) this
chapter might help you.
With Kind Regards,
Ovanes.
-----Original Message-----
From: Ovanes Markarian [mailto:om_boost@keywallet.com]
Sent: Freitag, 16. März 2007 21:44
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] [MPL] 2 Newbie Questions
BOOST_MPL_ASSERT operates on types, this also applies to mpl::or_
Try out:
#include
#include
#include
BOOST_MPL_ASSERT((true_)); //true is not a bool value it is a type it has
underscore...
BOOST_MPL_ASSERT((
mpl::or_(false_,
boost::is_same)
)); //false_ also a type...
With Kind Regards,
Ovanes
-----Original Message-----
From: Scott Meyers [mailto:usenet@aristeia.com]
Sent: Freitag, 16. März 2007 20:38
To: boost-users@lists.boost.org
Subject: [Boost-users] [MPL] 2 Newbie Questions
I'm trying to use the MPL for the first time, and I have two questions.
First, I want to use BOOST_MPL_ASSERT to say that at least one of two
conditions is true. For the time being, one of the conditions is always
false, so this is what I've tried:
BOOST_MPL_ASSERT((
false
||
boost::is_same
));
It won't compile, so I tried this:
BOOST_MPL_ASSERT((
mpl::or_(false,
boost::is_same)
));
It won't compile either. I'm guessing that I have to use mpl::false_ or
something in place of false, but that doesn't work either. Can somebody
please tell me the proper way to say what I want to say?
My second question is about the existence of an MPL algorithm akin to the
STL algorithm includes. Given two MPL vectors V1 and V2, I want to know if
all the types in V1 are also in V2. I know about mpl::contains, but I can't
find mpl::includes. Is there one, or do I need to write it myself?
I have the MPL book, so references to that are fine, in addition to anything
online.
Thanks,
Scott
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users