Boost logo

Boost Users :

From: Federico J. Fernández (federico.fernandez_at_[hidden])
Date: 2007-03-30 11:08:32


As you may know, I'm trying to use boost::statechart::events with
boost::variant, but I have the following problem. When I try to assign
a statechart::event to a variant<events...> I need to define operator=
for my class that is derived from the events.. and then when I call
the statechart::event::operator= the compiler throws the following
error:

/usr/include/boost/statechart/detail/rtti_policy.hpp: In member
function 'boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>& boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>::operator=(const
boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>&)':
/usr/include/boost/statechart/detail/rtti_policy.hpp:94: error:
non-static reference member 'const
boost::statechart::detail::id_provider&
boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>::idProvider_', can't use default assignment operator
/usr/include/boost/statechart/event_base.hpp: In member function
'boost::statechart::event_base&
boost::statechart::event_base::operator=(const
boost::statechart::event_base&)':
/usr/include/boost/statechart/event_base.hpp:51: note: synthesized
method 'boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>& boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>::operator=(const
boost::statechart::detail::rtti_policy::rtti_base_type<boost::statechart::detail::counted_base<true>
>&)' first required here
/usr/include/boost/statechart/detail/rtti_policy.hpp: In member
function 'boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>&
boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>::operator=(const
boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>&)':
/usr/include/boost/statechart/detail/rtti_policy.hpp:149: note:
synthesized method 'boost::statechart::event_base&
boost::statechart::event_base::operator=(const
boost::statechart::event_base&)' first required here
/usr/include/boost/statechart/event.hpp: In member function
'boost::statechart::event<evt_enviar_telegrama, std::allocator<void>
>& boost::statechart::event<evt_enviar_telegrama, std::allocator<void>
>::operator=(const boost::statechart::event<evt_enviar_telegrama,
std::allocator<void> >&)':
/usr/include/boost/statechart/event.hpp:32: note: synthesized method
'boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>&
boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>::operator=(const
boost::statechart::detail::rtti_policy::rtti_derived_type<evt_enviar_telegrama,
boost::statechart::event_base>&)' first required here
evento.h: In member function 'evt_enviar_telegrama&
evt_enviar_telegrama::operator=(const evt_enviar_telegrama&)':
evento.h:64: note: synthesized method
'boost::statechart::event<evt_enviar_telegrama, std::allocator<void>
>& boost::statechart::event<evt_enviar_telegrama, std::allocator<void>
>::operator=(const boost::statechart::event<evt_enviar_telegrama,
std::allocator<void> >&)' first required here

(evt_enviar_telegrama is one of the types of the variant, and I'm
calling sc::event<evt_enviar_telegrama>::operator=(t); line 64)

Any clues?

Thanks!


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