Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

BOOST_FUSION_DEFINE_STRUCT_INLINE

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.

Synopsis
BOOST_FUSION_DEFINE_STRUCT_INLINE(
    struct_name,
    (member_type0, member_name0)
    (member_type1, member_name1)
    ...
    )
Expression Semantics

The semantics of BOOST_FUSION_DEFINE_STRUCT_INLINE are identical to those of BOOST_FUSION_DEFINE_STRUCT, with two differences:

  1. BOOST_FUSION_DEFINE_STRUCT_INLINE can be used at class or namespace scope, and thus does not take a namespace list parameter.
  2. The structure generated by BOOST_FUSION_DEFINE_STRUCT_INLINE has a base class, and is thus not POD in C++03.
Header
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
#include <boost/fusion/include/define_struct_inline.hpp>
Example
// enclosing::employee is a Fusion sequence
class enclosing
{
    BOOST_FUSION_DEFINE_STRUCT_INLINE(
        employee,
        (std::string, name)
        (int, age))
};

PrevUpHomeNext