XS-libboost-mini
view release on metacpan or search on metacpan
include/boost/container/devector.hpp view on Meta::CPAN
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DEVECTOR_HPP
#define BOOST_CONTAINER_DEVECTOR_HPP
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
#include <cstring> // memcpy
#include <boost/assert.hpp>
#include <boost/container/detail/copy_move_algo.hpp>
#include <boost/container/new_allocator.hpp> //new_allocator
#include <boost/container/allocator_traits.hpp> //allocator_traits
#include <boost/container/detail/algorithm.hpp> //equal()
#include <boost/container/throw_exception.hpp>
#include <boost/container/options.hpp>
#include <boost/container/detail/guards_dended.hpp>
#include <boost/container/detail/iterator.hpp>
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/destroyers.hpp>
#include <boost/container/detail/min_max.hpp>
#include <boost/container/detail/next_capacity.hpp>
#include <boost/container/detail/alloc_helpers.hpp>
#include <boost/container/detail/advanced_insert_int.hpp>
// move
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/move/detail/fwd_macros.hpp>
#endif
#include <boost/move/detail/move_helpers.hpp>
#include <boost/move/adl_move_swap.hpp>
#include <boost/move/iterator.hpp>
#include <boost/move/traits.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/move/detail/to_raw_pointer.hpp>
#include <boost/move/algo/detail/merge.hpp>
//std
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list> //for std::initializer_list
#endif
namespace boost {
namespace container {
#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 {};
/**
* A vector-like sequence container providing front and back operations
* (e.g: `push_front`/`pop_front`/`push_back`/`pop_back`) with amortized constant complexity.
*
* Models the [SequenceContainer], [ReversibleContainer], and [AllocatorAwareContainer] concepts.
*
* **Requires**:
* - `T` shall be [MoveInsertable] into the devector.
* - `T` shall be [Erasable] from any `devector<T, allocator_type, GP>`.
* - `GrowthFactor`, and `Allocator` must model the concepts with the same names or be void.
*
* **Definition**: `T` is `NothrowConstructible` if it's either nothrow move constructible or
* nothrow copy constructible.
*
* **Definition**: `T` is `NothrowAssignable` if it's either nothrow move assignable or
* nothrow copy assignable.
*
* **Exceptions**: The exception specifications assume `T` is nothrow [Destructible].
*
* Most methods providing the strong exception guarantee assume `T` either has a move
* constructor marked noexcept or is [CopyInsertable] into the devector. If it isn't true,
* and the move constructor throws, the guarantee is waived and the effects are unspecified.
*
* In addition to the exceptions specified in the **Throws** clause, the following operations
* of `T` can throw when any of the specified concept is required:
* - [DefaultInsertable][]: Default constructor
* - [MoveInsertable][]: Move constructor
* - [CopyInsertable][]: Copy constructor
* - [DefaultConstructible][]: Default constructor
* - [EmplaceConstructible][]: Constructor selected by the given arguments
* - [MoveAssignable][]: Move assignment operator
* - [CopyAssignable][]: Copy assignment operator
*
* Furthermore, not `noexcept` methods throws whatever the allocator throws
* if memory allocation fails. Such methods also throw `length_error` if the capacity
* exceeds `max_size()`.
*
* **Remark**: If a method invalidates some iterators, it also invalidates references
* and pointers to the elements pointed by the invalidated iterators.
*
*! \tparam Options A type produced from \c boost::container::devector_options.
*
* [SequenceContainer]: http://en.cppreference.com/w/cpp/concept/SequenceContainer
* [ReversibleContainer]: http://en.cppreference.com/w/cpp/concept/ReversibleContainer
* [AllocatorAwareContainer]: http://en.cppreference.com/w/cpp/concept/AllocatorAwareContainer
* [DefaultInsertable]: http://en.cppreference.com/w/cpp/concept/DefaultInsertable
* [MoveInsertable]: http://en.cppreference.com/w/cpp/concept/MoveInsertable
* [CopyInsertable]: http://en.cppreference.com/w/cpp/concept/CopyInsertable
* [Erasable]: http://en.cppreference.com/w/cpp/concept/Erasable
* [DefaultConstructible]: http://en.cppreference.com/w/cpp/concept/DefaultConstructible
( run in 0.421 second using v1.01-cache-2.11-cpan-5511b514fd6 )