Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-02-03 08:19:44


On Tue, Feb 03, 2004 at 07:12:34AM -0500, David Abrahams wrote:
> "Andy Little" <andy_at_[hidden]> writes:
> > When used like this:
> >
> > boost::mpl::plus<int_<1>,int_<1> >::type.
> >
> > It is a compile time operation on the internal values of the int_'s
>
> No it isn't. The above is nonsense and won't compile.

Ok, I confess I haven't been following this thread, and also I don't
know MPL well. But what's wrong with the above?

   #include <iostream>
   #include "boost/mpl/plus.hpp"
   #include "boost/mpl/int.hpp"
   using namespace boost::mpl;
   using std::cout;
   using std::endl;
   int main() {
      cout << plus< int_<1>, int_<1> >::type::value << endl;
   }

seems to work and prints "2".

-- 
-Brian McNamara (lorgon_at_[hidden])

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