Boost logo

Boost Users :

Subject: Re: [Boost-users] [msm] EUML in a header file
From: Nate Knight (nate.knight_at_[hidden])
Date: 2011-05-12 12:36:16


Christophe Henry <christophe.j.henry <at> googlemail.com> writes:

>
> >Christophe Henry <christophe.j.henry <at> googlemail.com> writes:
> >
> >> You can also provide your own instances inside a front-end definition,
> >> thus eliminating the problem completely, as in:
> >>
> >http://www.boost.org/doc/libs/1_46_0/libs/msm/doc/HTML/examples/SimpleTutorialWithEumlTable.cpp
> >>

A couple more questions. I think you may be missing some more const specifiers in the trunk code. In common.hpp for instance, I think the following

#define BOOST_MSM_EUML_EVENT(instance_name) \
    struct instance_name ## _helper : msm::front::euml::euml_event<instance_name ## _helper>{ \
    instance_name ## _helper(){} \
    instance_name ## _helper const& operator()(){return *this;} }; \
    instance_name ## _helper const instance_name = instance_name ## _helper();

should be

#define BOOST_MSM_EUML_EVENT(instance_name) \
    struct instance_name ## _helper : msm::front::euml::euml_event<instance_name ## _helper>{ \
    instance_name ## _helper(){} \
    instance_name ## _helper const& operator()() const {return *this;} }; \
    instance_name ## _helper const instance_name = instance_name ## _helper();

If the operator() is not const then it can't be called on the defined instance.

Also, the addition of "= instance_name ## _helper();" makes the macros unusable in class definitions since instance_name is not static.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net