|
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
Hi,
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
in-between.
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
BOOST_FUSION_DEFINE_... macros?
Tobias
-- View this message in context: http://boost.2283326.n4.nabble.com/fusion-BOOST-FUSION-DEFINE-STRUCT-with-user-defined-methods-tp4666985.html Sent from the Boost - Users mailing list archive at Nabble.com.
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