I've made a pointer to a function, initDrop(unsigned int), and I get an error in visual studio, C2064, which states "term does not evaluate to a function taking 1 arguments".
Here's the important parts of the header file
namespace noise
{
namespace module
{
class ErosionModule : public Module
{
public:
void iterate(unsigned int iterations, unsigned int strength);
protected:
void initDrop(unsigned int iterations);
};
class Raindrop : public ErosionModule
{
public:
void calculate();
};
}
}
and heres the important parts of the cpp file that are failing, with the error line being on the call to funcRef(1000).
namespace noise
{
namespace module
{
void ErosionModule::initDrop(unsigned int iterations)
{
for (int i = 0; i < iterations; i++)
{
Raindrop drop;
drop.calculate();
}
}
void ErosionModule::iterate(unsigned int iterations, unsigned int strength)
{
auto funcRef = &noise::module::ErosionModule::initDrop;
funcRef(1000);
}
}
}
Help would be greatly appreciated