You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been quite some time since I've developed cpp but I'm stuck on trying to separate out the state classes from the State Machine Class's cpp file. No matter how I rearrange the code, I get an expected class-name before '{' token error defining the state class.
Using the Elevator example, let's say I wanted to pull out the Panic state class into it's own file. How would I do that?
If I put the panic class into panic.hpp and include it in Elevator.hpp, then I get
In file included from elevator.hpp:5,
from elevator.cpp:3:
panic.h:3:1: error: expected class-name before ‘{’ token
3 | {
The doc states
Note that the "elevator" example source code does not declare the states separately, but rather defines the code directly in the declaration.
So my question would be, how would I declare the states separately?
Thanks!
The text was updated successfully, but these errors were encountered:
It's been quite some time since I've developed cpp but I'm stuck on trying to separate out the state classes from the State Machine Class's cpp file. No matter how I rearrange the code, I get an
expected class-name before '{' token
error defining the state class.Using the Elevator example, let's say I wanted to pull out the Panic state class into it's own file. How would I do that?
If I put the panic class into panic.hpp and include it in Elevator.hpp, then I get
The doc states
So my question would be, how would I declare the states separately?
Thanks!
The text was updated successfully, but these errors were encountered: