Boost logo

Boost :

From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2008-05-22 05:10:10


I thought about something last night... since with the last
proposition, odd and even specializations are almost similar, it's
possible to simplify the code and remove the second template parameter
by doing this:

template <int N>
struct positive_power
    template <typename T>
    static typename tools::promote_args<T>::type result(T base)

At the cost of one additional template instantiation (power<0> will
always be instantiated) we get rid of the second parameter and have no
runtime evaluation, as advocated in the other thread.


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