Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2007-03-22 17:45:18


Federico J. Fernández wrote:
> Hi Boosters!
>
> I have been trying to use those libraries together. To be concrete, I
> want to have a variant of boost::statechart::event derived classes.
> The problem is that when I try to compile it I receive a lot of error
> messages, but the important ones say that there is no match for
> "operator new".. I mean, variant is calling a prototype of operator
> new that event doesn't offer.

Ouch, that's embarrassing. I've forgotten to overload placement new!
Scott Meyers item 9 :-(

I'll be checking in a fix this weekend. Problem is that this won't make
it into 1.34.0 as we're in the stage of code-freeze.

> /usr/include/boost/variant/variant.hpp: In constructor
> 'boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
> T13, T14, T15, T16, T17, T18, T19>::variant() [with T0_ [...]
>
> /usr/include/boost/variant/variant.hpp:1174: error: no matching
> function for call to 'evt_reset::operator new(unsigned int, void*)'
> /usr/include/boost/statechart/event.hpp:38: note: candidates are:
> static void* boost::statechart::event<MostDerived,
> Allocator>::operator new(size_t) [with MostDerived = evt_reset,
> Allocator = std::allocator<void>]
>
>
> Any idea? I want to have a container of this "events" and don't want
> to have a base class and working with virtual functions.

Out of curiosity, are these events processed by a
boost::statechart::state_machine at some point?

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header.

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