Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-04 08:43:51

0001 /////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga  2013-2013
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // See http://www.boost.org/libs/container for documentation.
0010 //
0011 /////////////////////////////////////////////////////////////////////////////
0012 
0013 #ifndef BOOST_CONTAINER_OPTIONS_HPP
0014 #define BOOST_CONTAINER_OPTIONS_HPP
0015 
0016 #ifndef BOOST_CONFIG_HPP
0017 #  include <boost/config.hpp>
0018 #endif
0019 
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 #  pragma once
0022 #endif
0023 
0024 #include <boost/container/detail/config_begin.hpp>
0025 #include <boost/container/container_fwd.hpp>
0026 #include <boost/container/detail/workaround.hpp>
0027 #include <boost/intrusive/pack_options.hpp>
0028 
0029 namespace boost {
0030 namespace container {
0031 
0032 ////////////////////////////////////////////////////////////////
0033 //
0034 //
0035 //       OPTIONS FOR ASSOCIATIVE TREE-BASED CONTAINERS
0036 //
0037 //
0038 ////////////////////////////////////////////////////////////////
0039 
0040 //! Enumeration used to configure ordered associative containers
0041 //! with a concrete tree implementation.
0042 enum tree_type_enum
0043 {
0044    red_black_tree,
0045    avl_tree,
0046    scapegoat_tree,
0047    splay_tree
0048 };
0049 
0050 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0051 
0052 template<tree_type_enum TreeType, bool OptimizeSize>
0053 struct tree_opt
0054 {
0055    BOOST_STATIC_CONSTEXPR boost::container::tree_type_enum tree_type = TreeType;
0056    BOOST_STATIC_CONSTEXPR bool optimize_size = OptimizeSize;
0057 };
0058 
0059 typedef tree_opt<red_black_tree, true> tree_assoc_defaults;
0060 
0061 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0062 
0063 //!This option setter specifies the underlying tree type
0064 //!(red-black, AVL, Scapegoat or Splay) for ordered associative containers
0065 BOOST_INTRUSIVE_OPTION_CONSTANT(tree_type, tree_type_enum, TreeType, tree_type)
0066 
0067 //!This option setter specifies if node size is optimized
0068 //!storing rebalancing data masked into pointers for ordered associative containers
0069 BOOST_INTRUSIVE_OPTION_CONSTANT(optimize_size, bool, Enabled, optimize_size)
0070 
0071 //! Helper metafunction to combine options into a single type to be used
0072 //! by \c boost::container::set, \c boost::container::multiset
0073 //! \c boost::container::map and \c boost::container::multimap.
0074 //! Supported options are: \c boost::container::optimize_size and \c boost::container::tree_type
0075 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0076 template<class ...Options>
0077 #else
0078 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0079 #endif
0080 struct tree_assoc_options
0081 {
0082    /// @cond
0083    typedef typename ::boost::intrusive::pack_options
0084       < tree_assoc_defaults,
0085       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0086       O1, O2, O3, O4
0087       #else
0088       Options...
0089       #endif
0090       >::type packed_options;
0091    typedef tree_opt<packed_options::tree_type, packed_options::optimize_size> implementation_defined;
0092    /// @endcond
0093    typedef implementation_defined type;
0094 };
0095 
0096 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0097 
0098 //! Helper alias metafunction to combine options into a single type to be used
0099 //! by tree-based associative containers
0100 template<class ...Options>
0101 using tree_assoc_options_t = typename boost::container::tree_assoc_options<Options...>::type;
0102 
0103 #endif
0104 
0105 
0106 ////////////////////////////////////////////////////////////////
0107 //
0108 //
0109 //       OPTIONS FOR ASSOCIATIVE HASH-BASED CONTAINERS
0110 //
0111 //
0112 ////////////////////////////////////////////////////////////////
0113 
0114 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0115 
0116 template<bool StoreHash, bool CacheBegin, bool LinearBuckets, bool FastmodBuckets>
0117 struct hash_opt
0118 {
0119    BOOST_STATIC_CONSTEXPR bool store_hash  = StoreHash;
0120    BOOST_STATIC_CONSTEXPR bool cache_begin = CacheBegin;
0121    BOOST_STATIC_CONSTEXPR bool linear_buckets = LinearBuckets;
0122    BOOST_STATIC_CONSTEXPR bool fastmod_buckets = FastmodBuckets;
0123 };
0124 
0125 typedef hash_opt<false, false, false, false> hash_assoc_defaults;
0126 
0127 //!This option setter specifies if nodes also store the hash value
0128 //!so that search and rehashing for hash-expensive types is improved.
0129 //!This option might degrade performance for easy to hash types (like integers)
0130 BOOST_INTRUSIVE_OPTION_CONSTANT(store_hash, bool, Enabled, store_hash)
0131 
0132 //!This option setter specifies if the container will cache the first
0133 //!non-empty bucket so that begin() is O(1) instead of searching for the
0134 //!first non-empty bucket (which can be O(bucket_size()))
0135 BOOST_INTRUSIVE_OPTION_CONSTANT(cache_begin, bool, Enabled, cache_begin)
0136 
0137 BOOST_INTRUSIVE_OPTION_CONSTANT(linear_buckets, bool, Enabled, linear_buckets)
0138 
0139 BOOST_INTRUSIVE_OPTION_CONSTANT(fastmod_buckets, bool, Enabled, fastmod_buckets)
0140 
0141 //! Helper metafunction to combine options into a single type to be used
0142 //! by \c boost::container::hash_set, \c boost::container::hash_multiset
0143 //! \c boost::container::hash_map and \c boost::container::hash_multimap.
0144 //! Supported options are: \c boost::container::store_hash
0145 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0146 template<class ...Options>
0147 #else
0148 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0149 #endif
0150 struct hash_assoc_options
0151 {
0152    /// @cond
0153    typedef typename ::boost::intrusive::pack_options
0154       < hash_assoc_defaults,
0155       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0156       O1, O2, O3, O4
0157       #else
0158       Options...
0159       #endif
0160       >::type packed_options;
0161    typedef hash_opt<packed_options::store_hash
0162                    ,packed_options::cache_begin
0163                    ,packed_options::linear_buckets
0164                    ,packed_options::fastmod_buckets
0165                    > implementation_defined;
0166    /// @endcond
0167    typedef implementation_defined type;
0168 };
0169 
0170 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0171 
0172 //! Helper alias metafunction to combine options into a single type to be used
0173 //! by hash-based associative containers
0174 template<class ...Options>
0175 using hash_assoc_options_t = typename boost::container::hash_assoc_options<Options...>::type;
0176 
0177 #endif
0178 
0179 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0180 
0181 ////////////////////////////////////////////////////////////////
0182 //
0183 //
0184 //          OPTIONS FOR VECTOR-BASED CONTAINERS
0185 //
0186 //
0187 ////////////////////////////////////////////////////////////////
0188 
0189 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0190 
0191 template<class T, class Default>
0192 struct default_if_void
0193 {
0194    typedef T type;
0195 };
0196 
0197 template<class Default>
0198 struct default_if_void<void, Default>
0199 {
0200    typedef Default type;
0201 };
0202 
0203 template<std::size_t N, std::size_t DefaultN>
0204 struct default_if_zero
0205 {
0206    BOOST_STATIC_CONSTEXPR std::size_t value = N;
0207 };
0208 
0209 template<std::size_t DefaultN>
0210 struct default_if_zero<0u, DefaultN>
0211 {
0212    BOOST_STATIC_CONSTEXPR std::size_t value = DefaultN;
0213 };
0214 
0215 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0216 
0217 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0218 
0219 template<class AllocTraits, class StoredSizeType>
0220 struct get_stored_size_type_with_alloctraits
0221 {
0222    typedef StoredSizeType type;
0223 };
0224 
0225 template<class AllocTraits>
0226 struct get_stored_size_type_with_alloctraits<AllocTraits, void>
0227 {
0228    typedef typename AllocTraits::size_type type;
0229 };
0230 
0231 template<class GrowthType, class StoredSizeType>
0232 struct vector_opt
0233 {
0234    typedef GrowthType      growth_factor_type;
0235    typedef StoredSizeType  stored_size_type;
0236 
0237    template<class AllocTraits>
0238    struct get_stored_size_type
0239       : get_stored_size_type_with_alloctraits<AllocTraits, StoredSizeType>
0240    {};
0241 };
0242 
0243 class default_next_capacity;
0244 
0245 typedef vector_opt<void, void> vector_null_opt;
0246 
0247 #else
0248 
0249 //!This growth factor argument specifies that the container should increase its
0250 //!capacity a 50% when existing capacity is exhausted.
0251 struct growth_factor_50{};
0252 
0253 //!This growth factor argument specifies that the container should increase its
0254 //!capacity a 60% when existing capacity is exhausted.
0255 struct growth_factor_60{};
0256 
0257 //!This growth factor argument specifies that the container should increase its
0258 //!capacity a 100% (doubling its capacity) when existing capacity is exhausted.
0259 struct growth_factor_100{};
0260 
0261 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0262 
0263 //!This option setter specifies the growth factor strategy of the
0264 //!underlying vector.
0265 //!
0266 //!\tparam GrowthFactor The function object that implements the growth factor
0267 //!
0268 //! The GrowthFactor function object must offer the following interface:
0269 //!
0270 //!\code
0271 //!template<class SizeType>
0272 //!SizeType operator()(SizeType cur_cap, SizeType add_min_cap, SizeType max_cap) const;
0273 //!\endcode
0274 //!
0275 //!Where:
0276 //!   * `cur_cap` is the current capacity
0277 //!   * `add_min_cap` is the minimum additional capacity we want to achieve
0278 //!   * `max_cap` is the maximum capacity that the allocator or other factors allow.
0279 //!
0280 //!The implementation should return a value between `cur_cap + add_min_cap`
0281 //!and `max_cap`. The implementation should handle the potential wraparound produced
0282 //!by the growth factor and always succeed with a correct value.
0283 //!
0284 //!Predefined growth factors that can be passed as arguments to this option are:
0285 //!\c boost::container::growth_factor_50,
0286 //!\c boost::container::growth_factor_60 and
0287 //!\c boost::container::growth_factor_100
0288 //!
0289 //!If this option is not specified, a default will be used by the container.
0290 BOOST_INTRUSIVE_OPTION_TYPE(growth_factor, GrowthFactor, GrowthFactor, growth_factor_type)
0291 
0292 //!This option specifies the unsigned integer type that a user wants the container
0293 //!to use to hold size-related information inside a container (e.g. current size, current capacity).
0294 //!
0295 //!\tparam StoredSizeType An unsigned integer type. It shall be smaller than than the size
0296 //! of the size_type deduced from `allocator_traits<A>::size_type` or the same type.
0297 //!
0298 //!If the maximum capacity() to be used is limited, a user can try to use 8-bit, 16-bit 
0299 //!(e.g. in 32-bit machines), or 32-bit size types (e.g. in a 64 bit machine) to see if some
0300 //!memory can be saved, specially for empty containers. This could potentially improve performance
0301 //!due to better cache usage.
0302 //!
0303 //!Note that alignment requirements can disallow theoretical space savings. Example:
0304 //!\c vector holds a pointer and two size types (for size and capacity), in a 32 bit machine
0305 //!a 8 bit size type (total size: 4 byte pointer + 2 x 1 byte sizes = 6 bytes) 
0306 //!will not save space when comparing two 16-bit size types because usually
0307 //!a 32 bit alignment is required for vector and the size will be rounded to 8 bytes. In a 64-bit
0308 //!machine a 16 bit size type does not usually save memory when comparing to a 32-bit size type.
0309 //!Measure the size of the resulting container and do not assume a smaller \c stored_size
0310 //!will always lead to a smaller sizeof(container).
0311 //!
0312 //!If a user tries to insert more elements than representable by \c stored_size, the container
0313 //!will throw a length_error.
0314 //!
0315 //!If this option is not specified, `allocator_traits<A>::size_type` (usually std::size_t) will
0316 //!be used to store size-related information inside the container.
0317 BOOST_INTRUSIVE_OPTION_TYPE(stored_size, StoredSizeType, StoredSizeType, stored_size_type)
0318 
0319 //! Helper metafunction to combine options into a single type to be used
0320 //! by \c boost::container::vector.
0321 //! Supported options are: \c boost::container::growth_factor and \c boost::container::stored_size
0322 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0323 template<class ...Options>
0324 #else
0325 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0326 #endif
0327 struct vector_options
0328 {
0329    /// @cond
0330    typedef typename ::boost::intrusive::pack_options
0331       < vector_null_opt,
0332       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0333       O1, O2, O3, O4
0334       #else
0335       Options...
0336       #endif
0337       >::type packed_options;
0338    typedef vector_opt< typename packed_options::growth_factor_type
0339                      , typename packed_options::stored_size_type> implementation_defined;
0340    /// @endcond
0341    typedef implementation_defined type;
0342 };
0343 
0344 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0345 
0346 //! Helper alias metafunction to combine options into a single type to be used
0347 //! by \c boost::container::vector.
0348 template<class ...Options>
0349 using vector_options_t = typename boost::container::vector_options<Options...>::type;
0350 
0351 #endif
0352 
0353 ////////////////////////////////////////////////////////////////
0354 //
0355 //
0356 //          OPTIONS FOR SMALL-VECTOR CONTAINER
0357 //
0358 //
0359 ////////////////////////////////////////////////////////////////
0360 
0361 //! This option specifies the desired alignment for the value_type stored
0362 //! in the container.
0363 //! A value zero represents the natural alignment.
0364 //!
0365 //!\tparam Alignment An unsigned integer value. Must be power of two.
0366 BOOST_INTRUSIVE_OPTION_CONSTANT(inplace_alignment, std::size_t, Alignment, inplace_alignment)
0367 
0368 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0369 
0370 template<class GrowthType, std::size_t InplaceAlignment, class StoredSizeType>
0371 struct small_vector_opt
0372 {
0373    typedef GrowthType     growth_factor_type;
0374    BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
0375    typedef StoredSizeType stored_size_type;
0376 };
0377 
0378 typedef small_vector_opt<void, 0u, void> small_vector_null_opt;
0379 
0380 #endif    //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0381 
0382 //! Helper metafunction to combine options into a single type to be used
0383 //! by \c boost::container::small_vector.
0384 //! Supported options are: \c boost::container::growth_factor,
0385 //! \c boost::container::inplace_alignment and
0386 //! \c boost::container::stored_size.
0387 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0388 template<class ...Options>
0389 #else
0390 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0391 #endif
0392 struct small_vector_options
0393 {
0394    /// @cond
0395    typedef typename ::boost::intrusive::pack_options
0396       < small_vector_null_opt,
0397       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0398       O1, O2, O3, O4
0399       #else
0400       Options...
0401       #endif
0402       >::type packed_options;
0403    typedef small_vector_opt< typename packed_options::growth_factor_type
0404                            , packed_options::inplace_alignment
0405                            , typename packed_options::stored_size_type
0406                            > implementation_defined;
0407    /// @endcond
0408    typedef implementation_defined type;
0409 };
0410 
0411 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0412 
0413 //! Helper alias metafunction to combine options into a single type to be used
0414 //! by \c boost::container::small_vector.
0415 template<class ...Options>
0416 using small_vector_options_t = typename boost::container::small_vector_options<Options...>::type;
0417 
0418 #endif
0419 
0420 
0421 ////////////////////////////////////////////////////////////////
0422 //
0423 //
0424 //          OPTIONS FOR STATIC-VECTOR CONTAINER
0425 //
0426 //
0427 ////////////////////////////////////////////////////////////////
0428 
0429 //!This option specifies if the container will throw if in
0430 //!the static capacity is not sufficient to hold the required
0431 //!values. If false is specified, insufficient capacity will
0432 //!lead to BOOST_ASSERT, and if this assertion returns, to undefined behaviour,
0433 //!which potentially can lead to better static_vector performance.
0434 //!The default value is true.
0435 //!
0436 //!\tparam ThrowOnExhaustion A boolean value. True if throw is required.
0437 BOOST_INTRUSIVE_OPTION_CONSTANT(throw_on_overflow, bool, ThrowOnOverflow, throw_on_overflow)
0438 
0439 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0440 
0441 template<bool ThrowOnOverflow, std::size_t InplaceAlignment, class StoredSizeType>
0442 struct static_vector_opt
0443 {
0444    BOOST_STATIC_CONSTEXPR bool throw_on_overflow = ThrowOnOverflow;
0445    BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
0446    typedef StoredSizeType stored_size_type;
0447 };
0448 
0449 typedef static_vector_opt<true, 0u, void> static_vector_null_opt;
0450 
0451 #endif    //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0452 
0453 //! Helper metafunction to combine options into a single type to be used
0454 //! by \c boost::container::static_vector.
0455 //! Supported options are: \c boost::container::throw_on_overflow, \c boost::container::inplace_alignment
0456 //! and \c boost::container::stored_size.
0457 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0458 template<class ...Options>
0459 #else
0460 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0461 #endif
0462 struct static_vector_options
0463 {
0464    /// @cond
0465    typedef typename ::boost::intrusive::pack_options
0466       < static_vector_null_opt,
0467       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0468       O1, O2, O3, O4
0469       #else
0470       Options...
0471       #endif
0472       >::type packed_options;
0473    typedef static_vector_opt< packed_options::throw_on_overflow
0474                             , packed_options::inplace_alignment
0475                             , typename packed_options::stored_size_type
0476                             > implementation_defined;
0477    /// @endcond
0478    typedef implementation_defined type;
0479 };
0480 
0481 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0482 
0483 //! Helper alias metafunction to combine options into a single type to be used
0484 //! by \c boost::container::static_vector.
0485 template<class ...Options>
0486 using static_vector_options_t = typename boost::container::static_vector_options<Options...>::type;
0487 
0488 #endif
0489 
0490 
0491 ////////////////////////////////////////////////////////////////
0492 //
0493 //
0494 //          OPTIONS FOR DEVECTOR CONTAINER
0495 //
0496 //
0497 ////////////////////////////////////////////////////////////////
0498 
0499 //!Thse options specify the relocation strategy of devector.
0500 //!
0501 //!Predefined relocation limits that can be passed as arguments to this option are:
0502 //!\c boost::container::relocate_on_66
0503 //!\c boost::container::relocate_on_75
0504 //!\c boost::container::relocate_on_80
0505 //!\c boost::container::relocate_on_85
0506 //!\c boost::container::relocate_on_90
0507 //!
0508 //!If this option is not specified, a default will be used by the container.
0509 //!
0510 //!Note: Repeated insertions at only one end (only back insertions or only front insertions) usually will
0511 //!lead to a single relocation when `relocate_on_66` is used and two relocations when `relocate_on_90`
0512 //!is used.
0513 
0514 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0515 
0516 BOOST_INTRUSIVE_OPTION_CONSTANT(relocate_on, std::size_t, Fraction, free_fraction)
0517 
0518 struct relocate_on_66 : public relocate_on<3U>{};
0519 
0520 struct relocate_on_75 : public relocate_on<4U> {};
0521 
0522 struct relocate_on_80 : public relocate_on<5U> {};
0523 
0524 struct relocate_on_85 : public relocate_on<7U> {};
0525 
0526 struct relocate_on_90 : public relocate_on<10U> {};
0527 
0528 template<class GrowthType, class StoredSizeType, std::size_t FreeFraction>
0529 struct devector_opt
0530    : vector_opt<GrowthType, StoredSizeType>
0531 {
0532    BOOST_STATIC_CONSTEXPR std::size_t free_fraction = FreeFraction;
0533 };
0534 
0535 typedef devector_opt<void, void, 0u> devector_null_opt;
0536 
0537 #else
0538 
0539 //!This relocation condition option specifies that the container will never relocate
0540 //!elements when there is no space at the side the insertion should
0541 //!take place
0542 struct relocate_never;
0543 
0544 //!This relocation condition option specifies that the container will relocate
0545 //!all elements when there is no space at the side the insertion should
0546 //!take place and memory usage is below 66% (2/3)
0547 struct relocate_on_66;
0548 
0549 //!This relocation condition option specifies that the container will relocate
0550 //!all elements when there is no space at the side the insertion should
0551 //!take place and memory usage is below 75% (3/4)
0552 struct relocate_on_75;
0553 
0554 //!This relocation condition option specifies that the container will relocate
0555 //!all elements when there is no space at the side the insertion should
0556 //!take place and memory usage is below 80% (4/5)
0557 struct relocate_on_80;
0558 
0559 //!This relocation condition option specifies that the container will relocate
0560 //!all elements when there is no space at the side the insertion should
0561 //!take place and memory usage is below 85% (6/7)
0562 struct relocate_on_85;
0563 
0564 //!This relocation condition option specifies that the container will relocate
0565 //!all elements when there is no space at the side the insertion should
0566 //!take place and memory usage is below 90% (9/10)
0567 struct relocate_on_90;
0568 
0569 #endif
0570 
0571 
0572 //! Helper metafunction to combine options into a single type to be used
0573 //! by \c boost::container::devector.
0574 //! Supported options are: \c boost::container::growth_factor, \c boost::container::stored_size
0575 //! and \c boost::container::relocate_on
0576 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0577 template<class ...Options>
0578 #else
0579 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0580 #endif
0581 struct devector_options
0582 {
0583    /// @cond
0584    typedef typename ::boost::intrusive::pack_options
0585       < devector_null_opt,
0586       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0587       O1, O2, O3, O4
0588       #else
0589       Options...
0590       #endif
0591       >::type packed_options;
0592    typedef devector_opt< typename packed_options::growth_factor_type
0593                        , typename packed_options::stored_size_type
0594                        , packed_options::free_fraction
0595                        > implementation_defined;
0596    /// @endcond
0597    typedef implementation_defined type;
0598 };
0599 
0600 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0601 
0602 //! Helper alias metafunction to combine options into a single type to be used
0603 //! by \c boost::container::devector.
0604 template<class ...Options>
0605 using devector_options_t = typename boost::container::devector_options<Options...>::type;
0606 
0607 #endif
0608 
0609 ////////////////////////////////////////////////////////////////
0610 //
0611 //
0612 //          OPTIONS FOR DEQUE-BASED CONTAINERS
0613 //
0614 //
0615 ////////////////////////////////////////////////////////////////
0616 
0617 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0618 
0619 template<std::size_t BlockBytes, std::size_t BlockSize, class StoredSizeType, bool Reservable>
0620 struct deque_opt
0621 {
0622    BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes;
0623    BOOST_STATIC_CONSTEXPR std::size_t block_size  = BlockSize;
0624    BOOST_CONTAINER_STATIC_ASSERT_MSG(!(block_bytes && block_size), "block_bytes and block_size can't be specified at the same time");
0625    BOOST_STATIC_CONSTEXPR bool reservable  = Reservable;
0626 
0627    typedef StoredSizeType  stored_size_type;
0628 
0629    template<class AllocTraits>
0630    struct get_stored_size_type
0631       : get_stored_size_type_with_alloctraits<AllocTraits, StoredSizeType>
0632    {};
0633 };
0634 
0635 typedef deque_opt<0u, 0u, void, false> deque_null_opt;
0636 
0637 #endif
0638 
0639 //! Helper metafunction to combine options into a single type to be used
0640 //! by \c boost::container::deque.
0641 //! Supported options are: \c boost::container::block_bytes, \c boost::container::block_size,
0642 //! \c boost::container::stored_size and \c boost::container::reservable
0643 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0644 template<class ...Options>
0645 #else
0646 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0647 #endif
0648 struct deque_options
0649 {
0650    /// @cond
0651    typedef typename ::boost::intrusive::pack_options
0652       < deque_null_opt,
0653       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0654       O1, O2, O3, O4
0655       #else
0656       Options...
0657       #endif
0658       >::type packed_options;
0659    typedef deque_opt< packed_options::block_bytes
0660                     , packed_options::block_size
0661                     , typename packed_options::stored_size_type
0662                     , packed_options::reservable
0663                     > implementation_defined;
0664    /// @endcond
0665    typedef implementation_defined type;
0666 };
0667 
0668 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0669 
0670 //! Helper alias metafunction to combine options into a single type to be used
0671 //! by \c boost::container::deque.
0672 template<class ...Options>
0673 using deque_options_t = typename boost::container::deque_options<Options...>::type;
0674 
0675 #endif
0676 
0677 //!This option specifies the maximum size of a block in bytes: this delimites the number of contiguous elements
0678 //!that will be allocated by some containers as min(1u, BlockBytes/sizeof(value_type))
0679 //!A value zero represents the default value.
0680 //!
0681 //!\tparam BlockBytes An unsigned integer value.
0682 BOOST_INTRUSIVE_OPTION_CONSTANT(block_bytes, std::size_t, BlockBytes, block_bytes)
0683 
0684 //!This option specifies the size of a block, delimites the number of contiguous elements
0685 //!that will be allocated by some containersas BlockSize.
0686 //!For some containers (like deque), a power of two value can improve performance.
0687 //!A value zero represents the default value.
0688 //!
0689 //!\tparam BlockBytes An unsigned integer value.
0690 BOOST_INTRUSIVE_OPTION_CONSTANT(block_size, std::size_t, BlockSize, block_size)
0691 
0692 //!This option specifies if the container has reserve/capacity-like features
0693 //!
0694 //!For some containers (like deque) this option might change the internal representation or
0695 //!behavior so that memory for elements can be allocated in advance in
0696 //!order to improve performance.
0697 //!
0698 //!\tparam Reservable An boolean value.
0699 BOOST_INTRUSIVE_OPTION_CONSTANT(reservable, bool, Reservable, reservable)
0700 
0701 }  //namespace container {
0702 }  //namespace boost {
0703 
0704 #include <boost/container/detail/config_end.hpp>
0705 
0706 #endif   //#ifndef BOOST_CONTAINER_OPTIONS_HPP