Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-03 09:16:09


Brian McNamara <lorgon_at_[hidden]> writes:

> 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".

Whoops; I was too hasty. What I read was:

        boost::mpl::plus<int_<_1>,int_<_1> >::type.
                              ^ ^

Sorry everyone.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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