Boost logo

Boost :

From: John Moeller (fishcorn_at_[hidden])
Date: 2008-05-15 11:40:42


John Moeller <fishcorn <at> gmail.com> writes:

> template <>
> struct positive_power<0,0>
> {
> template <typename T>
> static typename tools::promote_args<T>::type result(T base)
> {
> return 1;
> }
> };

In fact, you could get rid of the zero-power case of positive_power and make it
a specialization of the power_if_positive template. That way you could also
check for the 0^0 case, which just returns 1 right now.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk