#include <iostream>
#include <type_traits>
template<typename T, T b, T e>
struct constexpr_pow : std::integral_constant<T, b*constexpr_pow<T, b, e-1>::value>
{
};
template<typename T, T b>
struct constexpr_pow<T, b, 1> : std::integral_constant<T, b>
{
};
int main()
{
std::cout << constexpr_pow<unsigned, 2, 8>::value << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBULCBUIGIsIFQgZT4Kc3RydWN0IGNvbnN0ZXhwcl9wb3cgOiBzdGQ6OmludGVncmFsX2NvbnN0YW50PFQsIGIqY29uc3RleHByX3BvdzxULCBiLCBlLTE+Ojp2YWx1ZT4Kewp9Owp0ZW1wbGF0ZTx0eXBlbmFtZSBULCBUIGI+CnN0cnVjdCBjb25zdGV4cHJfcG93PFQsIGIsIDE+IDogc3RkOjppbnRlZ3JhbF9jb25zdGFudDxULCBiPgp7Cn07CgppbnQgbWFpbigpCnsKCXN0ZDo6Y291dCA8PCBjb25zdGV4cHJfcG93PHVuc2lnbmVkLCAyLCA4Pjo6dmFsdWUgPDwgc3RkOjplbmRsOwp9Cg==
prog.cpp:9:8: error: type ‘T’ of template argument ‘1’ depends on a template parameter
struct constexpr_pow<T, b, 1> : std::integral_constant<T, b>
^