Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-02 14:19:52


Aleksey Gurtovoy <agurtovoy_at_[hidden]> writes:

> Andy Little writes:
>> Reading the mpl documentation it states that boost::mpl::plus is
>> expected to be specialised for non Integral Constants.
>>
>> Therefore should the following work ?:
>>
>> typedef boost::mpl::plus<int,int>::type int_plus_int_type; // eg int
>> presumably
>>
>> OTOH it could be said that:
>>
>> mpl::plus<int_<1>, int_<1> >::type
>>
>> and
>>
>> mpl::plus<int,int>::type
>>
>> are conceptually different and that therefore mpl::plus<int,int>
>> should be(remain) invalid.
>>
>> Any thoughts?
>
> I'm strongly in favor of the latter premise.

That sort of "intrusive overloading" worries me. It would be one
thing if you could overload class templates, but to implement that
sort of thing you usually need internal dispatching.

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