
Hi, Is the following program supposed to compile with the new MPL? It works fine with boost 1.31, but apparantly fails in CVS. But, maybe I was mis-using equal_to ? #include <boost/mpl/equal_to.hpp> #include <boost/mpl/bool.hpp> int main() { boost::mpl::equal_to<boost::mpl::bool_<true>, boost::mpl::bool_<true> > dummy; } Error message from CVS is: (thanks to Matthias Troyer for testing it) ../boost/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp: In instantiation of `boost::mpl::equal_to_tag<mpl_::bool_< true> >': ../boost/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp:72: instantiated from `boost::mpl::equal_to<mpl_::bool_< true>, mpl_::bool_< true> >' test.C:11: instantiated from here ../boost/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp:60: error: no type named `tag' in `struct mpl_::bool_< true>' ../boost/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp: In instantiation of `boost::mpl::equal_to<mpl_::bool_< true>, mpl_::bool_< true> >': test.C:11: instantiated from here ../boost/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp:72: error: no type named `type' in `struct boost::mpl::equal_to_tag<mpl_::bool_< true> >' Cheers, Ian

--- Ian McCulloch <ianmcc@physik.rwth-aachen.de> wrote:
Hi,
Hello.
Is the following program supposed to compile with the new MPL?
Probably not.
But, maybe I was mis-using equal_to ?
equal_to<...> no longer accepts bool_<...> or any expressions resulting in bool_<...> as a template argument, since bool_<...> does not contain a typedef named tag (for numeric_cast<...>). I don't have the MPL book, so I don't know the rationale behind it, but working around it should be as simple as an eval_if<...> statement. HTH Cromwell Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Cromwell Enage <sponage@yahoo.com> writes:
--- Ian McCulloch <ianmcc@physik.rwth-aachen.de> wrote:
Hi,
Hello.
Is the following program supposed to compile with the new MPL?
Probably not.
But, maybe I was mis-using equal_to ?
equal_to<...> no longer accepts bool_<...> or any expressions resulting in bool_<...> as a template argument, since bool_<...> does not contain a typedef named tag (for numeric_cast<...>). I don't have the MPL book, so I don't know the rationale behind it
Unfortunately, that bit isn't covered in the book. I think Aleksey added the tag stuff very recently as a way of handling non-integral numeric types. It seems to me that bool_ really ought to have whatever tags int_ has. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams writes:
Cromwell Enage <sponage@yahoo.com> writes:
--- Ian McCulloch <ianmcc@physik.rwth-aachen.de> wrote:
Hi,
Hello.
Is the following program supposed to compile with the new MPL?
Probably not.
But, maybe I was mis-using equal_to ?
equal_to<...> no longer accepts bool_<...> or any expressions resulting in bool_<...> as a template argument, since bool_<...> does not contain a typedef named tag (for numeric_cast<...>). I don't have the MPL book, so I don't know the rationale behind it
Unfortunately, that bit isn't covered in the book. I think Aleksey added the tag stuff very recently as a way of handling non-integral numeric types.
Very-very recently.
It seems to me that bool_ really ought to have whatever tags int_ has.
Yep. -- Aleksey Gurtovoy MetaCommunications Engineering

Ian McCulloch writes:
Is the following program supposed to compile with the new MPL?
Yes.
It works fine with boost 1.31, but apparantly fails in CVS. But, maybe I was mis-using equal_to ?
Nope, your code is fine, it's a bug. Fixed in the CVS. Thank you for the report! -- Aleksey Gurtovoy MetaCommunications Engineering
participants (4)
-
Aleksey Gurtovoy
-
Cromwell Enage
-
David Abrahams
-
Ian McCulloch