Boost logo

Boost Users :

From: Andy Little (andy_at_[hidden])
Date: 2006-02-25 18:45:44


"David Abrahams" wrote
> "Andy Little" 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.

In what way am I misunderstanding it?

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

No seriously. Thanks for the illuminating moment.

>> 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?

Surely its pretty obvious isnt it ?

>> You might try reading the context in which that was said ........:-)
>
> I did. You might try clearly explaining what you're after.

I'm after a more precise solution, one that leaves .. how shall I put this
tactfully?... slightly less room for doubt.

>> (< 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,

Perhaps you'd like to clarify what you think I 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.

I dont understand this especially after your previous remarks. Now you seem to
be agreeing that what is delivered is unclear? I thought it couldnt be improved?

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