Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::mpl::plus changes type
From: Peter Foelsche (foelsche_at_[hidden])
Date: 2011-04-09 21:38:17


"Steven Watanabe" <watanabesj_at_[hidden]> wrote in message
news:4DA0FE31.7080401_at_providere-consulting.com...
> AMDG
>
> On 04/09/2011 04:36 PM, Peter Foelsche wrote:
>> It is a major annoyance that these arrithmetic operations return a
>> different type than the input!
>> I mean I input boost::mpl::long_ and I get a boost::mpl::integral_c
>>
>
> It isn't really different. mpl::long_ is
> just a shortcut for integral_c.

typename boost::mpl::at<
  typename boost::mpl::insert<
    boost::mpl::map<>,
    boost::mpl::pair<
      typename boost::mpl::plus<
        boost::mpl::long_<0>,
        boost::mpl::long_<1>
>::type,
      boost::mpl::long_<0>
>::type,
   boost::mpl::long_<1>
>::type

I think this gives void_.
In words (in case of I did something wrong):
Insert a result from add into a map and then try to find it via at.
It cannot be found anymore, as it is not a long_ but an integral_c now.

Peter


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