Boost logo

Boost Users :

Subject: [Boost-users] [fusion] BOOST_FUSION_DEFINE_STRUCT with user defined methods
From: Tobias Loew (Tobias.Loew_at_[hidden])
Date: 2014-08-27 02:07:10


I often use BOOST_FUSION_DEFINE_STRUCT not to generate a fusion-sequence per
se, but to get a struct with

- default initialisation for all members
- a reasonable set of constructors
- equality-check
- all above without additional code

But sometimes I would like to have additional methods in those structs, but
deriving from those or fusion-adapting them loses at least one of the nice
properties above.
After looking at the BOOST_FUSION_DEFINE_STRUCT implementation I though
about splitting the makro BOOST_FUSION_DEFINE_STRUCT_IMPL an inject my code
Now my questions are:

- Is there anything I've overseen and might detroy some fusion-mechanism?
- Is there any chance to get macros like
BOOST_FUSION_DEFINE_STRUCT_[BEGIN|END] (and also for the other


View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at