Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-02-05 12:30:43


John Maddock wrote:
> I'm a bit concerned about this interface: my guess is that 90% or more of
> users would just want integer exponents, and these should be very easy to
> use, preferably simply:
> pow<2>(val)
> Hmmm, I wonder if we can define an overload such that:
> pow<2,3>(val)
> is also valid?
> Regards, John.

Ok. How about:

template<class N, class T>
... pow(T t);

template<int N, class T>
... pow(T t) {
    return(pow<mpl::int_<N> >(t));

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at