diff options
Diffstat (limited to 'libs/fusion/doc/adapted.qbk')
-rw-r--r-- | libs/fusion/doc/adapted.qbk | 96 |
1 files changed, 95 insertions, 1 deletions
diff --git a/libs/fusion/doc/adapted.qbk b/libs/fusion/doc/adapted.qbk index fd8237cd04..93aa170305 100644 --- a/libs/fusion/doc/adapted.qbk +++ b/libs/fusion/doc/adapted.qbk @@ -658,7 +658,7 @@ __random_access_sequence__. [heading Synopsis] - BOOST_FUSION_ADAPT_ADT( + BOOST_FUSION_ADAPT_TPL_ADT( (template_param0)(template_param1)..., (type_name) (specialization_param0)(specialization_param1)..., (attribute_type0, attribute_const_type0, get_expr0, set_expr0) @@ -1115,6 +1115,100 @@ defined in __random_access_sequence__. [endsect] +[section:define_struct_inline BOOST_FUSION_DEFINE_STRUCT_INLINE] + +[heading Description] + +BOOST_FUSION_DEFINE_STRUCT_INLINE is a macro that can be used to generate all +the necessary boilerplate to define and adapt an arbitrary struct as a model of +__random_access_sequence__. Unlike BOOST_FUSION_DEFINE_STRUCT, it can be used +at class or namespace scope. + +[heading Synopsis] + + BOOST_FUSION_DEFINE_STRUCT_INLINE( + struct_name, + (member_type0, member_name0) + (member_type1, member_name1) + ... + ) + +[heading Expression Semantics] + +The semantics of BOOST_FUSION_DEFINE_STRUCT_INLINE are identical to those of +BOOST_FUSION_DEFINE_STRUCT, with two differences: + +# BOOST_FUSION_DEFINE_STRUCT_INLINE can be used at class or namespace scope, and + thus does not take a namespace list parameter. +# The structure generated by BOOST_FUSION_DEFINE_STRUCT_INLINE has a base class, + and is thus not POD in C++03. + +[heading Header] + + #include <boost/fusion/adapted/struct/define_struct_inline.hpp> + #include <boost/fusion/include/define_struct_inline.hpp> + +[heading Example] + + // enclosing::employee is a Fusion sequence + class enclosing + { + BOOST_FUSION_DEFINE_STRUCT_INLINE( + employee, + (std::string, name) + (int, age)) + }; + + +[endsect] + +[section:define_tpl_struct_inline BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE] + +[heading Description] + +BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE is a macro that can be used to generate +all the necessary boilerplate to define and adapt an arbitrary template struct +as a model of __random_access_sequence__. Unlike BOOST_FUSION_DEFINE_TPL_STRUCT, +it can be used at class or namespace scope. + +[heading Synopsis] + + BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( + (template_param0)(template_param1)..., + struct_name, + (member_type0, member_name0) + (member_type1, member_name1) + ... + ) + +[heading Expression Semantics] + +The semantics of BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE are identical to those of +BOOST_FUSION_DEFINE_TPL_STRUCT, with two differences: + +# BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE can be used at class or namespace scope, + and thus does not take a namespace list parameter. +# The structure generated by BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE has a base + class, and is thus not POD in C++03. + +[heading Header] + + #include <boost/fusion/adapted/struct/define_struct_inline.hpp> + #include <boost/fusion/include/define_struct_inline.hpp> + +[heading Example] + + // Any instantiated enclosing::employee is a Fusion sequence + class enclosing + { + BOOST_FUSION_DEFINE_TPL_STRUCT( + (Name)(Age), employee, + (Name, name) + (Age, age)) + }; + +[endsect] + [section:define_assoc_struct BOOST_FUSION_DEFINE_ASSOC_STRUCT] [heading Description] |