c++ - Problem passing vector of templated states to constructor -
Those people who are following the saga, I still have finite state machines, states & amp; Events that occur in "proper" C ++ mode with templates
What's wrong with this code?
template & lt; Typename StateTypeEnum, typename EventTypeEnum & gt; Class Fsm {public: Fsm (E_subSystems subsystem, example uint8_t, constants four * constant fsmName, constant std :: vector & lt; StateTypeEnum, EventTypeEnum & gt; & gt; & states of the state} / Code> where
template & lt; Typename StateTypeEnum, typename EventTypeEnum & gt; Class state (public: state (input E_subSystems subsystem, StateTypeEnum stateId, constant four * constant stateName, constant std :: map & lt; event; event event; eventTypeEnum & gt ;, eventhandlerfunction & events; & amp; events) Code> Only is an error message A similar function for the call fsm.h line 98 C / C ++ problem
It seems that the error message is for a non-existent
state To the default constructor Refers, but why?
E_callControlStates, E_callControEvents
were the template parameters to declare the object of Fsm (with no errors)
Obviously, I did something else to ignore I am; A st00pid N00b is making a mistake, but what? Thanks in advance
My bad course is that there was nothing with the code I was looking for - but then it rarely happens, it does
class Fsm Declared
private: state & lt ;? StateTypeName, EventTapAnnam & gt; _present situation;
When it was supposed to be
Private: State & lt; State type name, event type prize & gt; *_present situation;
, sorry for misleading you, people, and thanks for estimating the problem thing, despite the regrets.
In the problem code you do not exist, but most probably a member of the type state that some manufacturer The start list is not being started, compiling the compiler defaults to start it, and the compiler is not looking for the appropriate constructor. I can only assume that the 98 line is in the Fsm
constructor and the type of the member of Fsm
is state & lt; ... & gt;
.
Comments
Post a Comment