I want to make a function which returns a power of integer. Please read the fmuecke\'s solution in power of an integer in c++ .
However, I want to generalize his so
Here is a simple solution:
#include using namespace std; template struct Pow { enum { res = N * Pow::res}; }; template struct Pow { enum {res = 1}; }; int main() { cout<::res<<"\n"; }