[msm] forward declaration of state machine with non-default constructor

Hi,
I want to forward declare a state machine which has a non-default
constructor.
I found this example here: http://stackoverflow.com/a/10922799/678093
But I can't call the non-default constructor of the state machine.
I either get
- "error: call of overloaded ‘fsm(int)’ is ambiguous" (if inheriting
constructors using C++11) or
- "error: no matching function for call to ‘wrapper::fsm::fsm(int)"
What can I do about it?
Thanks,
Manuel
Example:
------------------------
// wrapper.h
#include

Hi Manuel,
I want to forward declare a state machine which has a non-default constructor.
struct wrapper::fsm : public boost::msm::back::state_machine
{ using boost::msm::back::state_machine ::state_machine; };
I think you can’t “using” template constructors. Try:
fsm(int some_value):boost::msm::back::state_machine

Hi Christophe,
thanks for the reply.
Sure, I can 'repeat' the constructor / its arguments. I just thought maybe
I can avoid this.
Bye
Manuel
2014-08-29 21:13 GMT+02:00
Hi Manuel,
I want to forward declare a state machine which has a non-default constructor. struct wrapper::fsm : public boost::msm::back::state_machine
{ using boost::msm::back::state_machine ::state_machine; }; I think you can’t “using” template constructors. Try:
fsm(int some_value):boost::msm::back::state_machine
(some_value){} HTH, Christophe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
caligano
-
christophe.j.henry@googlemail.com
-
Manuel Schiller