Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-02-25 12:38:22


"Andy Little" <andy_at_[hidden]> writes:

> "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 ..........? ;-)

Yes, you seem to.

>> is_same< int_<3>, integral_c<int,3> >::value
>>
>> is false. They are different types.
>
> Really ? Knock me down wiv a feather guvnor!

Ah, the distinctive musk of sarcasm.

> 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));

What is that supposed to illustrate? Your desires? Current behavior?

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

I did. You might try clearly explaining what you're after.

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

I know what it looks like. I can see how what's specified in the
manual is different from (less specific than) what I think you want,
but I don't see how what is actually delivered is any different from
what you want. Of course, exactly what you want is still unclear.

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

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