Boost logo

Boost Users :

Subject: Re: [Boost-users] [msm] EUML in a header file
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2011-05-12 17:21:40


> 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.

I forgot why I need this, to be frank, I need to have a look at it.

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

Ouch. How could I miss that one?
This leaves me with as only choice your first solution with static and
extra macros for the name.

Thanks,
Christophe


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