XS-libboost-mini

 view release on metacpan or  search on metacpan

include/boost/container/devector.hpp  view on Meta::CPAN


#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)

struct growth_factor_60;

template<class Options, class AllocatorSizeType>
struct get_devector_opt
{
    typedef devector_opt< typename default_if_void<typename Options::growth_factor_type, growth_factor_60>::type
                        , typename default_if_void<typename Options::stored_size_type, AllocatorSizeType>::type
                        , default_if_zero<Options::free_fraction, relocate_on_90::value>::value
                        > type;
};

template<class AllocatorSizeType>
struct get_devector_opt<void, AllocatorSizeType>
{
    typedef devector_opt< growth_factor_60, AllocatorSizeType, relocate_on_90::value> type;
};

#endif    //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)

struct reserve_only_tag_t {};
struct reserve_uninitialized_t {};
struct review_implementation_t {};

//struct unsafe_uninitialized_tag_t {};

include/boost/container/options.hpp  view on Meta::CPAN



////////////////////////////////////////////////////////////////
//
//
//          OPTIONS FOR DEVECTOR CONTAINER
//
//
////////////////////////////////////////////////////////////////

//!Thse options specify the relocation strategy of devector.
//!
//!Predefined relocation limits that can be passed as arguments to this option are:
//!\c boost::container::relocate_on_66
//!\c boost::container::relocate_on_75
//!\c boost::container::relocate_on_80
//!\c boost::container::relocate_on_85
//!\c boost::container::relocate_on_90
//!
//!If this option is not specified, a default will be used by the container.
//!
//!Note: Repeated insertions at only one end (only back insertions or only front insertions) usually will
//!lead to a single relocation when `relocate_on_66` is used and two relocations when `relocate_on_90`
//!is used.

#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)

BOOST_INTRUSIVE_OPTION_CONSTANT(relocate_on, std::size_t, Fraction, free_fraction)

struct relocate_on_66 : public relocate_on<3U>{};

struct relocate_on_75 : public relocate_on<4U> {};

struct relocate_on_80 : public relocate_on<5U> {};

struct relocate_on_85 : public relocate_on<7U> {};

struct relocate_on_90 : public relocate_on<10U> {};

template<class GrowthType, class StoredSizeType, std::size_t FreeFraction>
struct devector_opt
   : vector_opt<GrowthType, StoredSizeType>
{
   BOOST_STATIC_CONSTEXPR std::size_t free_fraction = FreeFraction;
};

typedef devector_opt<void, void, 0u> devector_null_opt;

#else

//!This relocation condition option specifies that the container will never relocate
//!elements when there is no space at the side the insertion should
//!take place
struct relocate_never;

//!This relocation condition option specifies that the container will relocate
//!all elements when there is no space at the side the insertion should
//!take place and memory usage is below 66% (2/3)
struct relocate_on_66;

//!This relocation condition option specifies that the container will relocate
//!all elements when there is no space at the side the insertion should
//!take place and memory usage is below 75% (3/4)
struct relocate_on_75;

//!This relocation condition option specifies that the container will relocate
//!all elements when there is no space at the side the insertion should
//!take place and memory usage is below 80% (4/5)
struct relocate_on_80;

//!This relocation condition option specifies that the container will relocate
//!all elements when there is no space at the side the insertion should
//!take place and memory usage is below 85% (6/7)
struct relocate_on_85;

//!This relocation condition option specifies that the container will relocate
//!all elements when there is no space at the side the insertion should
//!take place and memory usage is below 90% (9/10)
struct relocate_on_90;

#endif


//! Helper metafunction to combine options into a single type to be used
//! by \c boost::container::devector.
//! Supported options are: \c boost::container::growth_factor, \c boost::container::stored_size
//! and \c boost::container::relocate_on
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) || defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
template<class ...Options>
#else
template<class O1 = void, class O2 = void, class O3 = void, class O4 = void>
#endif
struct devector_options
{
   /// @cond
   typedef typename ::boost::intrusive::pack_options
      < devector_null_opt,



( run in 0.558 second using v1.01-cache-2.11-cpan-5511b514fd6 )