Pytanie:
struct functor
{
int operator() (int n)
{
void* temp = this;
return temp(n-1)+temp(n-2);
}
};
Czy niemozliwym jest wywolanie rekurencyjne klasy przez sama siebie za pomoca this ?
struct functor
{
int operator() (int n)
{
void* temp = this;
if(n == 0) return 0;
return temp(n-1)+temp(n-2);
}
};