C++ State Machine / Wpmf-convesion
A pointer to a member function is not allowed in C++. GCC can allow it, but moans at you because it's non-standard.

In C++ the normal way of dealing with the kind of thing you want is through class inheritance.

Typically you would create your base Fsm class that implements the basic functionality of your state machine control, then overlay over the top of that (create a new class that inherits the Fsm class) another class that implements your specific machine functionality.  You can declare functions in your base Fsm class that are pure virtual - that is, they exist, but have no body. It's then the job of the child class to actually implement that functionality.  The parent Fsm class then knows about those functions and can call them.

So you would have something like:

class Fsm {
    public:
        void dispatch();
    protected:
        virtual void initial() = 0;
}; 

void Fsm::dispatch() {
    initial() ;
}



class Machine : public Fsm {
    protected:
        void initial() {
             Serial.println("Here");
        }
}; 

Machine mach;

mach.dispatch(); // --&gt; "Here"


Fsm knows about initial(), but the function hasn't been further defined.  Machine implements initial().  You then create an instance of Machine which contains everything needed.  Calling dispatch() runs the function in the Fsm parent class which then calls initial() in the child Machine class.