سلام من برای به توان رسوندن عدد زمان کامپایل این کد رو نوشتم ولی این ارور رو میده ::
error: template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum) instantiating 'class Pow<5, -897>'
enum { result=Number*Pow<Number,Power-1>::result };
مشکل چیه ؟
#include <iostream>
template<int Number,int Power>
class Pow {
public:
enum { result=Number*Pow<Number,Power-1>::result };
};
int main()
{
Pow<5,3> a;
std::cout<<a.result;
}