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 a snapshot of the develop branch, built from commit dcea408971.
PrevUpHomeNext

Macro BOOST_INTRUSIVE_OPTION_CONSTANT

BOOST_INTRUSIVE_OPTION_CONSTANT

Synopsis

// In header: <boost/intrusive/pack_options.hpp>

BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME)

Description

Defines an option class of name OPTION_NAME that can be used to specify a constant of type TYPE with value VALUE...

struct OPTION_NAME<TYPE VALUE>
{  unspecified_content  };

...that after being combined with boost::intrusive::pack_options, will contain a CONSTANT_NAME static constant of value VALUE. Example:

//[includes and namespaces omitted for brevity]

//This macro will create the following class:
//    template<bool Enabled>
//    struct incremental
//    { unspecified_content };
BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental)

struct empty_default{};

const bool is_incremental = pack_options< empty_default, incremental<true> >::type::is_incremental;

BOOST_STATIC_ASSERT(( is_incremental == true ));


PrevUpHomeNext