Boost logo

Boost Users :

From: Andy Little (andy_at_[hidden])
Date: 2006-02-25 11:53:42


"David Abrahams" wrote
> "Andy Little" writes:
>
>> Maybe it could be changed to (something like)
>>
>> Return type: integral_c<
>> typeof(c1::value + c2::value)
>> , ( c1::value + c2::value )
>> > c;
>>
>> This would guarantee that is_same can be used on the
>> result. Currently I cant assume that.
>
> You seem to have a deep misunderstanding of the problem.

Do I ..........? ;-)

> is_same< int_<3>, integral_c<int,3> >::value
>
> is false. They are different types.

Really ? Knock me down wiv a feather guvnor!

    typedef mpl::plus<mpl::bool_<true>,mpl::bool_<true> >::type type1;
    typedef mpl::plus<mpl::int_<1>,mpl::int_<1> >::type type2;
    typedef mpl::plus<mpl::long_<1>,mpl::long_<1> >::type type3;
    typedef mpl::plus<mpl::integral_c<int,1>,mpl::integral_c<long,1>
>::type type4;

    assert((boost::is_same<type1, mpl::integral_c<bool,true> >::value));
    assert((boost::is_same<type2, mpl::integral_c<int,2> >::value));
    assert((boost::is_same<type3, mpl::integral_c<long,2> >::value));
    assert((boost::is_same<type4, mpl::integral_c<long,2> >::value));

You might try reading the context in which that was said ........:-)

(< hint > look in <boost/mpl/aux_/arithmetic_op.hpp> .......;-)

regards
Andy Little


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net