Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:31:02

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 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0128 
0129 //!This option setter specifies if nodes also store the hash value
0130 //!so that search and rehashing for hash-expensive types is improved.
0131 //!This option might degrade performance for easy to hash types (like integers)
0132 BOOST_INTRUSIVE_OPTION_CONSTANT(store_hash, bool, Enabled, store_hash)
0133 
0134 //!This option setter specifies if the container will cache the first
0135 //!non-empty bucket so that begin() is O(1) instead of searching for the
0136 //!first non-empty bucket (which can be O(bucket_size()))
0137 BOOST_INTRUSIVE_OPTION_CONSTANT(cache_begin, bool, Enabled, cache_begin)
0138 
0139 BOOST_INTRUSIVE_OPTION_CONSTANT(linear_buckets, bool, Enabled, linear_buckets)
0140 
0141 BOOST_INTRUSIVE_OPTION_CONSTANT(fastmod_buckets, bool, Enabled, fastmod_buckets)
0142 
0143 //! Helper metafunction to combine options into a single type to be used
0144 //! by \c boost::container::hash_set, \c boost::container::hash_multiset
0145 //! \c boost::container::hash_map and \c boost::container::hash_multimap.
0146 //! Supported options are: \c boost::container::store_hash
0147 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0148 template<class ...Options>
0149 #else
0150 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0151 #endif
0152 struct hash_assoc_options
0153 {
0154    /// @cond
0155    typedef typename ::boost::intrusive::pack_options
0156       < hash_assoc_defaults,
0157       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0158       O1, O2, O3, O4
0159       #else
0160       Options...
0161       #endif
0162       >::type packed_options;
0163    typedef hash_opt<packed_options::store_hash
0164                    ,packed_options::cache_begin
0165                    ,packed_options::linear_buckets
0166                    ,packed_options::fastmod_buckets
0167                    > implementation_defined;
0168    /// @endcond
0169    typedef implementation_defined type;
0170 };
0171 
0172 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0173 
0174 //! Helper alias metafunction to combine options into a single type to be used
0175 //! by hash-based associative containers
0176 template<class ...Options>
0177 using hash_assoc_options_t = typename boost::container::hash_assoc_options<Options...>::type;
0178 
0179 #endif
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 
0216 
0217 #endif
0218 
0219 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0220 
0221 template<class AllocTraits, class StoredSizeType>
0222 struct get_stored_size_type_with_alloctraits
0223 {
0224    typedef StoredSizeType type;
0225 };
0226 
0227 template<class AllocTraits>
0228 struct get_stored_size_type_with_alloctraits<AllocTraits, void>
0229 {
0230    typedef typename AllocTraits::size_type type;
0231 };
0232 
0233 template<class GrowthType, class StoredSizeType>
0234 struct vector_opt
0235 {
0236    typedef GrowthType      growth_factor_type;
0237    typedef StoredSizeType  stored_size_type;
0238 
0239    template<class AllocTraits>
0240    struct get_stored_size_type
0241       : get_stored_size_type_with_alloctraits<AllocTraits, StoredSizeType>
0242    {};
0243 };
0244 
0245 class default_next_capacity;
0246 
0247 typedef vector_opt<void, void> vector_null_opt;
0248 
0249 #else    //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0250 
0251 //!This growth factor argument specifies that the container should increase its
0252 //!capacity a 50% when existing capacity is exhausted.
0253 struct growth_factor_50{};
0254 
0255 //!This growth factor argument specifies that the container should increase its
0256 //!capacity a 60% when existing capacity is exhausted.
0257 struct growth_factor_60{};
0258 
0259 //!This growth factor argument specifies that the container should increase its
0260 //!capacity a 100% (doubling its capacity) when existing capacity is exhausted.
0261 struct growth_factor_100{};
0262 
0263 #endif   //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0264 
0265 //!This option setter specifies the growth factor strategy of the underlying vector.
0266 //!
0267 //!\tparam GrowthFactor A function object that has the following signature:<br/><br/>
0268 //!`template<class SizeType>`<br/>
0269 //!`SizeType operator()(SizeType cur_cap, SizeType add_min_cap, SizeType max_cap) const;`.<br/><br/>
0270 //!`cur_cap` is the current capacity, `add_min_cap` is the minimum additional capacity
0271 //!we want to achieve and `max_cap` is the maximum capacity that the allocator or other 
0272 //!factors allow. The implementation should return a value between `cur_cap` + `add_min_cap`
0273 //!and `max_cap`. `cur_cap` + `add_min_cap` is guaranteed not to overflow/wraparound,
0274 //! but the implementation should handle wraparound produced by the growth factor.
0275 //!
0276 //!Predefined growth factors that can be passed as arguments to this option are:
0277 //!\c boost::container::growth_factor_50
0278 //!\c boost::container::growth_factor_60
0279 //!\c boost::container::growth_factor_100
0280 //!
0281 //!If this option is not specified, a default will be used by the container.
0282 BOOST_INTRUSIVE_OPTION_TYPE(growth_factor, GrowthFactor, GrowthFactor, growth_factor_type)
0283 
0284 //!This option specifies the unsigned integer type that a user wants the container
0285 //!to use to hold size-related information inside a container (e.g. current size, current capacity).
0286 //!
0287 //!\tparam StoredSizeType An unsigned integer type. It shall be smaller than than the size
0288 //! of the size_type deduced from `allocator_traits<A>::size_type` or the same type.
0289 //!
0290 //!If the maximum capacity() to be used is limited, a user can try to use 8-bit, 16-bit 
0291 //!(e.g. in 32-bit machines), or 32-bit size types (e.g. in a 64 bit machine) to see if some
0292 //!memory can be saved, specially for empty containers. This could potentially improve performance
0293 //!due to better cache usage.
0294 //!
0295 //!Note that alignment requirements can disallow theoretical space savings. Example:
0296 //!\c vector holds a pointer and two size types (for size and capacity), in a 32 bit machine
0297 //!a 8 bit size type (total size: 4 byte pointer + 2 x 1 byte sizes = 6 bytes) 
0298 //!will not save space when comparing two 16-bit size types because usually
0299 //!a 32 bit alignment is required for vector and the size will be rounded to 8 bytes. In a 64-bit
0300 //!machine a 16 bit size type does not usually save memory when comparing to a 32-bit size type.
0301 //!Measure the size of the resulting container and do not assume a smaller \c stored_size
0302 //!will always lead to a smaller sizeof(container).
0303 //!
0304 //!If a user tries to insert more elements than representable by \c stored_size, the container
0305 //!will throw a length_error.
0306 //!
0307 //!If this option is not specified, `allocator_traits<A>::size_type` (usually std::size_t) will
0308 //!be used to store size-related information inside the container.
0309 BOOST_INTRUSIVE_OPTION_TYPE(stored_size, StoredSizeType, StoredSizeType, stored_size_type)
0310 
0311 //! Helper metafunction to combine options into a single type to be used
0312 //! by \c boost::container::vector.
0313 //! Supported options are: \c boost::container::growth_factor and \c boost::container::stored_size
0314 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0315 template<class ...Options>
0316 #else
0317 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0318 #endif
0319 struct vector_options
0320 {
0321    /// @cond
0322    typedef typename ::boost::intrusive::pack_options
0323       < vector_null_opt,
0324       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0325       O1, O2, O3, O4
0326       #else
0327       Options...
0328       #endif
0329       >::type packed_options;
0330    typedef vector_opt< typename packed_options::growth_factor_type
0331                      , typename packed_options::stored_size_type> implementation_defined;
0332    /// @endcond
0333    typedef implementation_defined type;
0334 };
0335 
0336 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0337 
0338 //! Helper alias metafunction to combine options into a single type to be used
0339 //! by \c boost::container::vector.
0340 template<class ...Options>
0341 using vector_options_t = typename boost::container::vector_options<Options...>::type;
0342 
0343 #endif
0344 
0345 ////////////////////////////////////////////////////////////////
0346 //
0347 //
0348 //          OPTIONS FOR SMALL-VECTOR CONTAINER
0349 //
0350 //
0351 ////////////////////////////////////////////////////////////////
0352 
0353 //! This option specifies the desired alignment for the value_type stored
0354 //! in the container.
0355 //! A value zero represents the natural alignment.
0356 //!
0357 //!\tparam Alignment An unsigned integer value. Must be power of two.
0358 BOOST_INTRUSIVE_OPTION_CONSTANT(inplace_alignment, std::size_t, Alignment, inplace_alignment)
0359 
0360 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0361 
0362 template<class GrowthType, std::size_t InplaceAlignment, class StoredSizeType>
0363 struct small_vector_opt
0364 {
0365    typedef GrowthType     growth_factor_type;
0366    BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
0367    typedef StoredSizeType stored_size_type;
0368 };
0369 
0370 typedef small_vector_opt<void, 0u, void> small_vector_null_opt;
0371 
0372 #endif    //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0373 
0374 //! Helper metafunction to combine options into a single type to be used
0375 //! by \c boost::container::small_vector.
0376 //! Supported options are: \c boost::container::growth_factor,
0377 //! \c boost::container::inplace_alignment and
0378 //! \c boost::container::stored_size.
0379 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0380 template<class ...Options>
0381 #else
0382 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0383 #endif
0384 struct small_vector_options
0385 {
0386    /// @cond
0387    typedef typename ::boost::intrusive::pack_options
0388       < small_vector_null_opt,
0389       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0390       O1, O2, O3, O4
0391       #else
0392       Options...
0393       #endif
0394       >::type packed_options;
0395    typedef small_vector_opt< typename packed_options::growth_factor_type
0396                            , packed_options::inplace_alignment
0397                            , typename packed_options::stored_size_type
0398                            > implementation_defined;
0399    /// @endcond
0400    typedef implementation_defined type;
0401 };
0402 
0403 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0404 
0405 //! Helper alias metafunction to combine options into a single type to be used
0406 //! by \c boost::container::small_vector.
0407 template<class ...Options>
0408 using small_vector_options_t = typename boost::container::small_vector_options<Options...>::type;
0409 
0410 #endif
0411 
0412 
0413 ////////////////////////////////////////////////////////////////
0414 //
0415 //
0416 //          OPTIONS FOR STATIC-VECTOR CONTAINER
0417 //
0418 //
0419 ////////////////////////////////////////////////////////////////
0420 
0421 //!This option specifies if the container will throw if in
0422 //!the static capacity is not sufficient to hold the required
0423 //!values. If false is specified, insufficient capacity will
0424 //!lead to BOOST_ASSERT, and if this assertion returns, to undefined behaviour,
0425 //!which potentially can lead to better static_vector performance.
0426 //!The default value is true.
0427 //!
0428 //!\tparam ThrowOnExhaustion A boolean value. True if throw is required.
0429 BOOST_INTRUSIVE_OPTION_CONSTANT(throw_on_overflow, bool, ThrowOnOverflow, throw_on_overflow)
0430 
0431 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0432 
0433 template<bool ThrowOnOverflow, std::size_t InplaceAlignment, class StoredSizeType>
0434 struct static_vector_opt
0435 {
0436    BOOST_STATIC_CONSTEXPR bool throw_on_overflow = ThrowOnOverflow;
0437    BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
0438    typedef StoredSizeType stored_size_type;
0439 };
0440 
0441 typedef static_vector_opt<true, 0u, void> static_vector_null_opt;
0442 
0443 #endif    //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0444 
0445 //! Helper metafunction to combine options into a single type to be used
0446 //! by \c boost::container::static_vector.
0447 //! Supported options are: \c boost::container::throw_on_overflow, \c boost::container::inplace_alignment
0448 //! and \c boost::container::stored_size.
0449 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0450 template<class ...Options>
0451 #else
0452 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0453 #endif
0454 struct static_vector_options
0455 {
0456    /// @cond
0457    typedef typename ::boost::intrusive::pack_options
0458       < static_vector_null_opt,
0459       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0460       O1, O2, O3, O4
0461       #else
0462       Options...
0463       #endif
0464       >::type packed_options;
0465    typedef static_vector_opt< packed_options::throw_on_overflow
0466                             , packed_options::inplace_alignment
0467                             , typename packed_options::stored_size_type
0468                             > implementation_defined;
0469    /// @endcond
0470    typedef implementation_defined type;
0471 };
0472 
0473 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0474 
0475 //! Helper alias metafunction to combine options into a single type to be used
0476 //! by \c boost::container::static_vector.
0477 template<class ...Options>
0478 using static_vector_options_t = typename boost::container::static_vector_options<Options...>::type;
0479 
0480 #endif
0481 
0482 
0483 ////////////////////////////////////////////////////////////////
0484 //
0485 //
0486 //          OPTIONS FOR DEVECTOR CONTAINER
0487 //
0488 //
0489 ////////////////////////////////////////////////////////////////
0490 
0491 //!Thse options specify the relocation strategy of devector.
0492 //!
0493 //!Predefined relocation limits that can be passed as arguments to this option are:
0494 //!\c boost::container::relocate_on_66
0495 //!\c boost::container::relocate_on_75
0496 //!\c boost::container::relocate_on_80
0497 //!\c boost::container::relocate_on_85
0498 //!\c boost::container::relocate_on_90
0499 //!
0500 //!If this option is not specified, a default will be used by the container.
0501 //!
0502 //!Note: Repeated insertions at only one end (only back insertions or only front insertions) usually will
0503 //!lead to a single relocation when `relocate_on_66` is used and two relocations when `relocate_on_90`
0504 //!is used.
0505 
0506 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0507 
0508 BOOST_INTRUSIVE_OPTION_CONSTANT(relocate_on, std::size_t, Fraction, free_fraction)
0509 
0510 struct relocate_on_66 : public relocate_on<3U>{};
0511 
0512 struct relocate_on_75 : public relocate_on<4U> {};
0513 
0514 struct relocate_on_80 : public relocate_on<5U> {};
0515 
0516 struct relocate_on_85 : public relocate_on<7U> {};
0517 
0518 struct relocate_on_90 : public relocate_on<10U> {};
0519 
0520 template<class GrowthType, class StoredSizeType, std::size_t FreeFraction>
0521 struct devector_opt
0522    : vector_opt<GrowthType, StoredSizeType>
0523 {
0524    BOOST_STATIC_CONSTEXPR std::size_t free_fraction = FreeFraction;
0525 };
0526 
0527 typedef devector_opt<void, void, 0u> devector_null_opt;
0528 
0529 #else
0530 
0531 //!This relocation condition option specifies that the container will never relocate
0532 //!elements when there is no space at the side the insertion should
0533 //!take place
0534 struct relocate_never;
0535 
0536 //!This relocation condition option specifies that the container will relocate
0537 //!all elements when there is no space at the side the insertion should
0538 //!take place and memory usage is below 66% (2/3)
0539 struct relocate_on_66;
0540 
0541 //!This relocation condition option specifies that the container will relocate
0542 //!all elements when there is no space at the side the insertion should
0543 //!take place and memory usage is below 75% (3/4)
0544 struct relocate_on_75;
0545 
0546 //!This relocation condition option specifies that the container will relocate
0547 //!all elements when there is no space at the side the insertion should
0548 //!take place and memory usage is below 80% (4/5)
0549 struct relocate_on_80;
0550 
0551 //!This relocation condition option specifies that the container will relocate
0552 //!all elements when there is no space at the side the insertion should
0553 //!take place and memory usage is below 85% (6/7)
0554 struct relocate_on_85;
0555 
0556 //!This relocation condition option specifies that the container will relocate
0557 //!all elements when there is no space at the side the insertion should
0558 //!take place and memory usage is below 90% (9/10)
0559 struct relocate_on_90;
0560 
0561 #endif
0562 
0563 
0564 //! Helper metafunction to combine options into a single type to be used
0565 //! by \c boost::container::devector.
0566 //! Supported options are: \c boost::container::growth_factor, \c boost::container::stored_size
0567 //! and \c boost::container::relocate_on
0568 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0569 template<class ...Options>
0570 #else
0571 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0572 #endif
0573 struct devector_options
0574 {
0575    /// @cond
0576    typedef typename ::boost::intrusive::pack_options
0577       < devector_null_opt,
0578       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0579       O1, O2, O3, O4
0580       #else
0581       Options...
0582       #endif
0583       >::type packed_options;
0584    typedef devector_opt< typename packed_options::growth_factor_type
0585                        , typename packed_options::stored_size_type
0586                        , packed_options::free_fraction
0587                        > implementation_defined;
0588    /// @endcond
0589    typedef implementation_defined type;
0590 };
0591 
0592 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0593 
0594 //! Helper alias metafunction to combine options into a single type to be used
0595 //! by \c boost::container::devector.
0596 template<class ...Options>
0597 using devector_options_t = typename boost::container::devector_options<Options...>::type;
0598 
0599 #endif
0600 
0601 ////////////////////////////////////////////////////////////////
0602 //
0603 //
0604 //          OPTIONS FOR DEQUE-BASED CONTAINERS
0605 //
0606 //
0607 ////////////////////////////////////////////////////////////////
0608 
0609 #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
0610 
0611 template<std::size_t BlockBytes, std::size_t BlockSize>
0612 struct deque_opt
0613 {
0614    BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes;
0615    BOOST_STATIC_CONSTEXPR std::size_t block_size  = BlockSize;
0616    BOOST_CONTAINER_STATIC_ASSERT_MSG(!(block_bytes && block_size), "block_bytes and block_size can't be specified at the same time");
0617 };
0618 
0619 typedef deque_opt<0u, 0u> deque_null_opt;
0620 
0621 #endif
0622 
0623 //! Helper metafunction to combine options into a single type to be used
0624 //! by \c boost::container::deque.
0625 //! Supported options are: \c boost::container::block_bytes and \c boost::container::block_size
0626 #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0627 template<class ...Options>
0628 #else
0629 template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
0630 #endif
0631 struct deque_options
0632 {
0633    /// @cond
0634    typedef typename ::boost::intrusive::pack_options
0635       < deque_null_opt,
0636       #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
0637       O1, O2, O3, O4
0638       #else
0639       Options...
0640       #endif
0641       >::type packed_options;
0642    typedef deque_opt< packed_options::block_bytes, packed_options::block_size > implementation_defined;
0643    /// @endcond
0644    typedef implementation_defined type;
0645 };
0646 
0647 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0648 
0649 //! Helper alias metafunction to combine options into a single type to be used
0650 //! by \c boost::container::deque.
0651 template<class ...Options>
0652 using deque_options_t = typename boost::container::deque_options<Options...>::type;
0653 
0654 #endif
0655 
0656 //!This option specifies the maximum size of a block in bytes: this delimites the number of contiguous elements
0657 //!that will be allocated by deque as min(1u, BlockBytes/sizeof(value_type))
0658 //!A value zero represents the default value.
0659 //!
0660 //!\tparam BlockBytes An unsigned integer value.
0661 BOOST_INTRUSIVE_OPTION_CONSTANT(block_bytes, std::size_t, BlockBytes, block_bytes)
0662 
0663 //!This option specifies the size of a block, delimites the number of contiguous elements
0664 //!that will be allocated by deque as BlockSize.
0665 //!A value zero represents the default value.
0666 //!
0667 //!\tparam BlockBytes An unsigned integer value.
0668 BOOST_INTRUSIVE_OPTION_CONSTANT(block_size, std::size_t, BlockSize, block_size)
0669 
0670 }  //namespace container {
0671 }  //namespace boost {
0672 
0673 #include <boost/container/detail/config_end.hpp>
0674 
0675 #endif   //#ifndef BOOST_CONTAINER_OPTIONS_HPP