1 /////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2013-2013
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/libs/container for documentation.
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_CONTAINER_OPTIONS_HPP
14 #define BOOST_CONTAINER_OPTIONS_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
24 #include <boost/container/detail/config_begin.hpp>
25 #include <boost/container/container_fwd.hpp>
26 #include <boost/intrusive/pack_options.hpp>
31 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
33 template<tree_type_enum TreeType, bool OptimizeSize>
36 static const boost::container::tree_type_enum tree_type = TreeType;
37 static const bool optimize_size = OptimizeSize;
40 #endif //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
42 //!This option setter specifies the underlying tree type
43 //!(red-black, AVL, Scapegoat or Splay) for ordered associative containers
44 BOOST_INTRUSIVE_OPTION_CONSTANT(tree_type, tree_type_enum, TreeType, tree_type)
46 //!This option setter specifies if node size is optimized
47 //!storing rebalancing data masked into pointers for ordered associative containers
48 BOOST_INTRUSIVE_OPTION_CONSTANT(optimize_size, bool, Enabled, optimize_size)
50 //! Helper metafunction to combine options into a single type to be used
51 //! by \c boost::container::set, \c boost::container::multiset
52 //! \c boost::container::map and \c boost::container::multimap.
53 //! Supported options are: \c boost::container::optimize_size and \c boost::container::tree_type
54 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
55 template<class ...Options>
57 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
59 struct tree_assoc_options
62 typedef typename ::boost::intrusive::pack_options
63 < tree_assoc_defaults,
64 #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
69 >::type packed_options;
70 typedef tree_opt<packed_options::tree_type, packed_options::optimize_size> implementation_defined;
72 typedef implementation_defined type;
75 } //namespace container {
78 #include <boost/container/detail/config_end.hpp>
80 #endif //#ifndef BOOST_CONTAINER_OPTIONS_HPP