-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
Hi there, sorry but I don't know if this is the best place to put my question.
I'm testing the library and I want that my events have state, and that state can be std::string.
Strange when i compile my project on clang there is no problem but if i compile it on gcc i have the following error on the events that has std::string:
sml.hpp:675:5: error: cast from 'boost::ext::sml::v1_1_11::aux::byte*' {aka 'unsigned char*'} to 'MyEvent*' increases required alignment of target type [-Werror=cast-align]
[build] 675 | reinterpret_cast<T *>(data)->~T();
where the MyEvent is simple:
struct MyEvent { std::string data; }
Two questions:
- why clang does not complain about this?
- is it possible to change this behavior of storing data, i do not have concerns about memory, my object can be copied.
I see this example where it is used the BOOST_SML_CREATE_DEFAULT_CONSTRUCTIBLE_DEPS but i did not understood if is related or not, your examples only have int's on the data.
Thank you.
Metadata
Metadata
Assignees
Labels
No labels