Boost logo

Boost Users :

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


"Steven Watanabe" <watanabesj_at_[hidden]> wrote in message
news:4DA10FAE.20202_at_providere-consulting.com...

> MPL in general gives no guarantee about the
> exact types that operations produce.

Please don't treat me like a customer of a US cellphone company (grin).

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


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