This example shows an efficient way of calculating power using template metaprogramming.
template <int base, unsigned int exponent>
struct power
{
static const int halfvalue = power<base, exponent / 2>::value;
static const int value = halfvalue * halfvalue * power<base, e...