Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::mpl::plus changes type
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2011-04-10 02:12:31


On 10/04/11 04:22, Peter Foelsche wrote:
> Please don't treat me like a customer of a US cellphone company (grin).
I LOL'd

> template<long I> struct long_
> { static const long value = I;
>
> template<long J>
> struct create
> { typedef long_<J> type;
> };
> };
>
> template<typename T0, typename T1>
> struct plus
> { typedef typename T0::template create<T0::value + T1::value>::type
> type;
> };
What about mpl::plus< mpl::char<1>, mpl::long<2> > ?
you need to get the common type out of char and long then rebuild it.
Currently we put it in an integral_c. Doing it as you wish require a
small look-up
to match Type -> mpl::Type.

Would you mind filling a ticket so I dont lose this ?


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