I have this following struct (in the header file):
struct StateTransitions {
State currentState;
State nextState;
void (*fn)();
StateTransitions (State currentState, State nextState, void (*fn)())
{
}
};
And I am trying to push some instances of this struct into a vector (inside .cpp file):
void MyClass::Start()
{
}
transitions.push_back(StateTransitions(Low, Started, &MyClass::Start));
I cannot get this to compile. I am not sure if my declaration of the constructor inside the class is correct.
What is the correct way to add a constructor so I can't add this type of objects to my vector ?
I am using pre-C++11.