is there any problem with inheritance and std::function?
because adding std::function to a my child class corrupts my code.
I have no idea how,where and when but adding just the declaration std::function<void()> test;
is enough to break everything.
example:
class Timer : public ITickable
{
std::function<void()> test; //adding this does weird things
virtual void Tick() {}
}
class MyClass
{
ITickable* tickable_;
void Tick()
{
tickable_->Tick(); //let's assume it points to a Timer obj.
}
}
How is it corrupting your code? Compete minimal example if possible. Even better, a link to online compiler page showing problem would be cool. http://coliru.stacked-crooked.com/