summaryrefslogtreecommitdiff
path: root/boost/container
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/container
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/container')
-rw-r--r--boost/container/adaptive_pool.hpp38
-rw-r--r--boost/container/allocator.hpp10
-rw-r--r--boost/container/allocator_traits.hpp114
-rw-r--r--boost/container/container_fwd.hpp35
-rw-r--r--boost/container/deque.hpp94
-rw-r--r--boost/container/detail/adaptive_node_pool.hpp6
-rw-r--r--boost/container/detail/adaptive_node_pool_impl.hpp4
-rw-r--r--boost/container/detail/addressof.hpp4
-rw-r--r--boost/container/detail/advanced_insert_int.hpp24
-rw-r--r--boost/container/detail/alloc_helpers.hpp16
-rw-r--r--boost/container/detail/allocator_version_traits.hpp14
-rw-r--r--boost/container/detail/construct_in_place.hpp2
-rw-r--r--boost/container/detail/container_or_allocator_rebind.hpp4
-rw-r--r--boost/container/detail/container_rebind.hpp4
-rw-r--r--boost/container/detail/copy_move_algo.hpp172
-rw-r--r--boost/container/detail/destroyers.hpp16
-rw-r--r--boost/container/detail/dispatch_uses_allocator.hpp110
-rw-r--r--boost/container/detail/flat_tree.hpp510
-rw-r--r--boost/container/detail/is_container.hpp4
-rw-r--r--boost/container/detail/is_contiguous_container.hpp4
-rw-r--r--boost/container/detail/is_sorted.hpp4
-rw-r--r--boost/container/detail/iterator.hpp30
-rw-r--r--boost/container/detail/iterator_to_raw_pointer.hpp4
-rw-r--r--boost/container/detail/iterators.hpp18
-rw-r--r--boost/container/detail/math_functions.hpp4
-rw-r--r--boost/container/detail/min_max.hpp4
-rw-r--r--boost/container/detail/mpl.hpp4
-rw-r--r--boost/container/detail/multiallocation_chain.hpp10
-rw-r--r--boost/container/detail/mutex.hpp4
-rw-r--r--boost/container/detail/next_capacity.hpp72
-rw-r--r--boost/container/detail/node_alloc_holder.hpp48
-rw-r--r--boost/container/detail/node_pool.hpp8
-rw-r--r--boost/container/detail/node_pool_impl.hpp4
-rw-r--r--boost/container/detail/pair.hpp28
-rw-r--r--boost/container/detail/pool_common.hpp4
-rw-r--r--boost/container/detail/pool_common_alloc.hpp14
-rw-r--r--boost/container/detail/singleton.hpp4
-rw-r--r--boost/container/detail/transform_iterator.hpp2
-rw-r--r--boost/container/detail/tree.hpp161
-rw-r--r--boost/container/detail/type_traits.hpp4
-rw-r--r--boost/container/detail/value_functors.hpp36
-rw-r--r--boost/container/detail/value_init.hpp4
-rw-r--r--boost/container/detail/variadic_templates_tools.hpp4
-rw-r--r--boost/container/detail/version_type.hpp16
-rw-r--r--boost/container/flat_map.hpp454
-rw-r--r--boost/container/flat_set.hpp52
-rw-r--r--boost/container/list.hpp75
-rw-r--r--boost/container/map.hpp52
-rw-r--r--boost/container/node_allocator.hpp38
-rw-r--r--boost/container/node_handle.hpp12
-rw-r--r--boost/container/options.hpp165
-rw-r--r--boost/container/pmr/flat_map.hpp12
-rw-r--r--boost/container/pmr/flat_set.hpp12
-rw-r--r--boost/container/pmr/map.hpp8
-rw-r--r--boost/container/pmr/polymorphic_allocator.hpp4
-rw-r--r--boost/container/pmr/resource_adaptor.hpp2
-rw-r--r--boost/container/pmr/set.hpp8
-rw-r--r--boost/container/scoped_allocator.hpp38
-rw-r--r--boost/container/set.hpp54
-rw-r--r--boost/container/slist.hpp88
-rw-r--r--boost/container/small_vector.hpp33
-rw-r--r--boost/container/stable_vector.hpp44
-rw-r--r--boost/container/static_vector.hpp22
-rw-r--r--boost/container/string.hpp162
-rw-r--r--boost/container/uses_allocator.hpp10
-rw-r--r--boost/container/vector.hpp630
66 files changed, 1958 insertions, 1693 deletions
diff --git a/boost/container/adaptive_pool.hpp b/boost/container/adaptive_pool.hpp
index ac14fb397e..900806a649 100644
--- a/boost/container/adaptive_pool.hpp
+++ b/boost/container/adaptive_pool.hpp
@@ -83,19 +83,19 @@ class adaptive_pool
typedef T * pointer;
typedef const T * const_pointer;
typedef typename ::boost::container::
- container_detail::unvoid_ref<T>::type reference;
+ dtl::unvoid_ref<T>::type reference;
typedef typename ::boost::container::
- container_detail::unvoid_ref<const T>::type const_reference;
+ dtl::unvoid_ref<const T>::type const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
version_type<self_t, Version> version;
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
basic_multiallocation_chain<void*> multiallocation_chain_void;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
transform_multiallocation_chain
<multiallocation_chain_void, T> multiallocation_chain;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -156,9 +156,9 @@ class adaptive_pool
boost::container::throw_bad_alloc();
if(Version == 1 && count == 1){
- typedef typename container_detail::shared_adaptive_node_pool
+ typedef typename dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
return pointer(static_cast<T*>(singleton_t::instance().allocate_node()));
}
else{
@@ -172,9 +172,9 @@ class adaptive_pool
{
(void)count;
if(Version == 1 && count == 1){
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_node(ptr);
}
else{
@@ -203,9 +203,9 @@ class adaptive_pool
//!Throws bad_alloc if there is no enough memory
pointer allocate_one()
{
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
return (pointer)singleton_t::instance().allocate_node();
}
@@ -213,9 +213,9 @@ class adaptive_pool
//!Elements must be individually deallocated with deallocate_one()
void allocate_individual(std::size_t num_elements, multiallocation_chain &chain)
{
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().allocate_nodes(num_elements, static_cast<typename shared_pool_t::multiallocation_chain&>(chain));
//typename shared_pool_t::multiallocation_chain ch;
//singleton_t::instance().allocate_nodes(num_elements, ch);
@@ -228,17 +228,17 @@ class adaptive_pool
//!with other functions different from allocate_one(). Never throws
void deallocate_one(pointer p) BOOST_NOEXCEPT_OR_NOTHROW
{
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_node(p);
}
void deallocate_individual(multiallocation_chain &chain) BOOST_NOEXCEPT_OR_NOTHROW
{
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
//typename shared_pool_t::multiallocation_chain ch(&*chain.begin(), &*chain.last(), chain.size());
//singleton_t::instance().deallocate_nodes(ch);
singleton_t::instance().deallocate_nodes(chain);
@@ -297,9 +297,9 @@ class adaptive_pool
//!Deallocates all free blocks of the pool
static void deallocate_free_blocks() BOOST_NOEXCEPT_OR_NOTHROW
{
- typedef container_detail::shared_adaptive_node_pool
+ typedef dtl::shared_adaptive_node_pool
<sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_free_blocks();
}
diff --git a/boost/container/allocator.hpp b/boost/container/allocator.hpp
index 9b9268f16c..c0deb0a108 100644
--- a/boost/container/allocator.hpp
+++ b/boost/container/allocator.hpp
@@ -49,11 +49,11 @@ class allocator<void, Version, AllocationDisableMask>
typedef const int & const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
version_type<self_t, Version> version;
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
basic_multiallocation_chain<void*> multiallocation_chain;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -133,14 +133,14 @@ class allocator
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
version_type<self_t, Version> version;
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
basic_multiallocation_chain<void*> void_multiallocation_chain;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
transform_multiallocation_chain
<void_multiallocation_chain, T> multiallocation_chain;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
diff --git a/boost/container/allocator_traits.hpp b/boost/container/allocator_traits.hpp
index b08f601461..af32f182b6 100644
--- a/boost/container/allocator_traits.hpp
+++ b/boost/container/allocator_traits.hpp
@@ -50,21 +50,21 @@
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME allocate
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 2
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 2
#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME destroy
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 1
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 1
#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME construct
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 1
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 9
@@ -87,7 +87,7 @@ BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_select_on_container_copy_co
} //namespace allocator_traits_detail {
-namespace container_detail {
+namespace dtl {
//workaround needed for C++03 compilers with no construct()
//supporting rvalue references
@@ -121,7 +121,7 @@ BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(is_always_equal)
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(difference_type)
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(is_partially_propagable)
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -196,59 +196,59 @@ struct allocator_traits
{ typedef see_documentation type; };
#else
//pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
pointer, value_type*)
pointer;
//const_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::dtl::, Allocator,
const_pointer, typename boost::intrusive::pointer_traits<pointer>::template
rebind_pointer<const value_type>)
const_pointer;
//reference
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- reference, typename container_detail::unvoid_ref<value_type>::type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ reference, typename dtl::unvoid_ref<value_type>::type)
reference;
//const_reference
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- const_reference, typename container_detail::unvoid_ref<const value_type>::type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ const_reference, typename dtl::unvoid_ref<const value_type>::type)
const_reference;
//void_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::dtl::, Allocator,
void_pointer, typename boost::intrusive::pointer_traits<pointer>::template
rebind_pointer<void>)
void_pointer;
//const_void_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::dtl::, Allocator,
const_void_pointer, typename boost::intrusive::pointer_traits<pointer>::template
rebind_pointer<const void>)
const_void_pointer;
//difference_type
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
difference_type, std::ptrdiff_t)
difference_type;
//size_type
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
size_type, std::size_t)
size_type;
//propagate_on_container_copy_assignment
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- propagate_on_container_copy_assignment, container_detail::false_type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ propagate_on_container_copy_assignment, dtl::false_type)
propagate_on_container_copy_assignment;
//propagate_on_container_move_assignment
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- propagate_on_container_move_assignment, container_detail::false_type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ propagate_on_container_move_assignment, dtl::false_type)
propagate_on_container_move_assignment;
//propagate_on_container_swap
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- propagate_on_container_swap, container_detail::false_type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ propagate_on_container_swap, dtl::false_type)
propagate_on_container_swap;
//is_always_equal
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- is_always_equal, container_detail::is_empty<Allocator>)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ is_always_equal, dtl::is_empty<Allocator>)
is_always_equal;
//is_partially_propagable
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Allocator,
- is_partially_propagable, container_detail::false_type)
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::dtl::, Allocator,
+ is_partially_propagable, dtl::false_type)
is_partially_propagable;
//rebind_alloc & rebind_traits
@@ -302,10 +302,10 @@ struct allocator_traits
//! otherwise, invokes <code>a.allocate(n)</code>
BOOST_CONTAINER_FORCEINLINE static pointer allocate(Allocator &a, size_type n, const_void_pointer p)
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_allocate
<Allocator, const size_type, const const_void_pointer>::value;
- container_detail::bool_<value> flag;
+ dtl::bool_<value> flag;
return allocator_traits::priv_allocate(flag, a, n, p);
}
@@ -315,10 +315,10 @@ struct allocator_traits
BOOST_CONTAINER_FORCEINLINE static void destroy(Allocator &a, T*p) BOOST_NOEXCEPT_OR_NOTHROW
{
typedef T* destroy_pointer;
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_destroy
<Allocator, const destroy_pointer>::value;
- container_detail::bool_<value> flag;
+ dtl::bool_<value> flag;
allocator_traits::priv_destroy(flag, a, p);
}
@@ -327,21 +327,21 @@ struct allocator_traits
BOOST_CONTAINER_FORCEINLINE static size_type max_size(const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
{
const bool value = allocator_traits_detail::has_max_size<Allocator, size_type (Allocator::*)() const>::value;
- container_detail::bool_<value> flag;
+ dtl::bool_<value> flag;
return allocator_traits::priv_max_size(flag, a);
}
//! <b>Returns</b>: <code>a.select_on_container_copy_construction()</code> if that expression is well-formed;
//! otherwise, a.
BOOST_CONTAINER_FORCEINLINE static BOOST_CONTAINER_DOC1ST(Allocator,
- typename container_detail::if_c
+ typename dtl::if_c
< allocator_traits_detail::has_select_on_container_copy_construction<Allocator BOOST_MOVE_I Allocator (Allocator::*)() const>::value
BOOST_MOVE_I Allocator BOOST_MOVE_I const Allocator & >::type)
select_on_container_copy_construction(const Allocator &a)
{
const bool value = allocator_traits_detail::has_select_on_container_copy_construction
<Allocator, Allocator (Allocator::*)() const>::value;
- container_detail::bool_<value> flag;
+ dtl::bool_<value> flag;
return allocator_traits::priv_select_on_container_copy_construction(flag, a);
}
@@ -352,11 +352,11 @@ struct allocator_traits
BOOST_CONTAINER_FORCEINLINE static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args)
{
static const bool value = ::boost::move_detail::and_
- < container_detail::is_not_std_allocator<Allocator>
- , boost::container::container_detail::has_member_function_callable_with_construct
+ < dtl::is_not_std_allocator<Allocator>
+ , boost::container::dtl::has_member_function_callable_with_construct
< Allocator, T*, Args... >
>::value;
- container_detail::bool_<value> flag;
+ dtl::bool_<value> flag;
allocator_traits::priv_construct(flag, a, p, ::boost::forward<Args>(args)...);
}
#endif
@@ -365,7 +365,7 @@ struct allocator_traits
//! <code>false</code>.
BOOST_CONTAINER_FORCEINLINE static bool storage_is_unpropagable(const Allocator &a, pointer p) BOOST_NOEXCEPT_OR_NOTHROW
{
- container_detail::bool_<is_partially_propagable::value> flag;
+ dtl::bool_<is_partially_propagable::value> flag;
return allocator_traits::priv_storage_is_unpropagable(flag, a, p);
}
@@ -373,45 +373,45 @@ struct allocator_traits
//! <code>a == b</code>.
BOOST_CONTAINER_FORCEINLINE static bool equal(const Allocator &a, const Allocator &b) BOOST_NOEXCEPT_OR_NOTHROW
{
- container_detail::bool_<is_always_equal::value> flag;
+ dtl::bool_<is_always_equal::value> flag;
return allocator_traits::priv_equal(flag, a, b);
}
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
private:
- BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(container_detail::true_type, Allocator &a, size_type n, const_void_pointer p)
+ BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(dtl::true_type, Allocator &a, size_type n, const_void_pointer p)
{ return a.allocate(n, p); }
- BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(container_detail::false_type, Allocator &a, size_type n, const_void_pointer)
+ BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(dtl::false_type, Allocator &a, size_type n, const_void_pointer)
{ return a.allocate(n); }
template<class T>
- BOOST_CONTAINER_FORCEINLINE static void priv_destroy(container_detail::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE static void priv_destroy(dtl::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW
{ a.destroy(p); }
template<class T>
- BOOST_CONTAINER_FORCEINLINE static void priv_destroy(container_detail::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE static void priv_destroy(dtl::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW
{ p->~T(); (void)p; }
- BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(container_detail::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(dtl::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
{ return a.max_size(); }
- BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(container_detail::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(dtl::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return size_type(-1)/sizeof(value_type); }
- BOOST_CONTAINER_FORCEINLINE static Allocator priv_select_on_container_copy_construction(container_detail::true_type, const Allocator &a)
+ BOOST_CONTAINER_FORCEINLINE static Allocator priv_select_on_container_copy_construction(dtl::true_type, const Allocator &a)
{ return a.select_on_container_copy_construction(); }
- BOOST_CONTAINER_FORCEINLINE static const Allocator &priv_select_on_container_copy_construction(container_detail::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE static const Allocator &priv_select_on_container_copy_construction(dtl::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
{ return a; }
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class T, class ...Args>
- BOOST_CONTAINER_FORCEINLINE static void priv_construct(container_detail::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args)
+ BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args)
{ a.construct( p, ::boost::forward<Args>(args)...); }
template<class T, class ...Args>
- BOOST_CONTAINER_FORCEINLINE static void priv_construct(container_detail::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args)
+ BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args)
{ ::new((void*)p, boost_container_new_t()) T(::boost::forward<Args>(args)...); }
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
public:
@@ -421,11 +421,11 @@ struct allocator_traits
BOOST_CONTAINER_FORCEINLINE static void construct(Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
static const bool value = ::boost::move_detail::and_ \
- < container_detail::is_not_std_allocator<Allocator> \
- , boost::container::container_detail::has_member_function_callable_with_construct \
+ < dtl::is_not_std_allocator<Allocator> \
+ , boost::container::dtl::has_member_function_callable_with_construct \
< Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_FWD_T##N > \
>::value; \
- container_detail::bool_<value> flag;\
+ dtl::bool_<value> flag;\
(priv_construct)(flag, a, p BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
}\
//
@@ -438,11 +438,11 @@ struct allocator_traits
/////////////////////////////////
#define BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL(N) \
template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- BOOST_CONTAINER_FORCEINLINE static void priv_construct(container_detail::true_type, Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
+ BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::true_type, Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{ a.construct( p BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); }\
\
template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- BOOST_CONTAINER_FORCEINLINE static void priv_construct(container_detail::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
+ BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{ ::new((void*)p, boost_container_new_t()) T(BOOST_MOVE_FWD##N); }\
//
BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL)
@@ -451,19 +451,19 @@ struct allocator_traits
#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class T>
- BOOST_CONTAINER_FORCEINLINE static void priv_construct(container_detail::false_type, Allocator &, T *p, const ::boost::container::default_init_t&)
+ BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p, const ::boost::container::default_init_t&)
{ ::new((void*)p, boost_container_new_t()) T; }
- BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(container_detail::true_type, const Allocator &a, pointer p)
+ BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(dtl::true_type, const Allocator &a, pointer p)
{ return a.storage_is_unpropagable(p); }
- BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(container_detail::false_type, const Allocator &, pointer)
+ BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(dtl::false_type, const Allocator &, pointer)
{ return false; }
- BOOST_CONTAINER_FORCEINLINE static bool priv_equal(container_detail::true_type, const Allocator &, const Allocator &)
+ BOOST_CONTAINER_FORCEINLINE static bool priv_equal(dtl::true_type, const Allocator &, const Allocator &)
{ return true; }
- BOOST_CONTAINER_FORCEINLINE static bool priv_equal(container_detail::false_type, const Allocator &a, const Allocator &b)
+ BOOST_CONTAINER_FORCEINLINE static bool priv_equal(dtl::false_type, const Allocator &a, const Allocator &b)
{ return a == b; }
#endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
diff --git a/boost/container/container_fwd.hpp b/boost/container/container_fwd.hpp
index e85a6ce952..e4fe6f85c3 100644
--- a/boost/container/container_fwd.hpp
+++ b/boost/container/container_fwd.hpp
@@ -67,7 +67,7 @@ namespace detail{
//Create namespace to avoid compilation errors
}}}
-namespace boost{ namespace container{ namespace container_detail{
+namespace boost{ namespace container{ namespace dtl{
namespace bi = boost::intrusive;
namespace bid = boost::intrusive::detail;
}}}
@@ -88,23 +88,14 @@ namespace boost{ namespace container{ namespace pmr{
namespace boost {
namespace container {
-//! Enumeration used to configure ordered associative containers
-//! with a concrete tree implementation.
-enum tree_type_enum
-{
- red_black_tree,
- avl_tree,
- scapegoat_tree,
- splay_tree
-};
-
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
template<class T>
class new_allocator;
template <class T
- ,class Allocator = new_allocator<T> >
+ ,class Allocator = new_allocator<T>
+ ,class Options = void>
class vector;
template <class T
@@ -130,35 +121,30 @@ template <class T
,class Allocator = new_allocator<T> >
class slist;
-template<tree_type_enum TreeType, bool OptimizeSize>
-struct tree_opt;
-
-typedef tree_opt<red_black_tree, true> tree_assoc_defaults;
-
template <class Key
,class Compare = std::less<Key>
,class Allocator = new_allocator<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void>
class set;
template <class Key
,class Compare = std::less<Key>
,class Allocator = new_allocator<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
class multiset;
template <class Key
,class T
,class Compare = std::less<Key>
,class Allocator = new_allocator<std::pair<const Key, T> >
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
class map;
template <class Key
,class T
,class Compare = std::less<Key>
,class Allocator = new_allocator<std::pair<const Key, T> >
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
class multimap;
template <class Key
@@ -246,13 +232,6 @@ class synchronized_pool_resource;
} //namespace pmr {
-#else
-
-//! Default options for tree-based associative containers
-//! - tree_type<red_black_tree>
-//! - optimize_size<true>
-typedef implementation_defined tree_assoc_defaults;
-
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
//! Type used to tag that the input range is
diff --git a/boost/container/deque.hpp b/boost/container/deque.hpp
index b838f6e4eb..9565144839 100644
--- a/boost/container/deque.hpp
+++ b/boost/container/deque.hpp
@@ -68,7 +68,7 @@ template <class T>
struct deque_value_traits
{
typedef T value_type;
- static const bool trivial_dctr = container_detail::is_trivially_destructible<value_type>::value;
+ static const bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value;
static const bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move<value_type>::value;
};
@@ -82,7 +82,7 @@ struct deque_buf_size
static const std::size_t value = sizeof_t < min_size ? (min_size/sizeof_t) : std::size_t(1);
};
-namespace container_detail {
+namespace dtl {
// Class invariants:
// For any nonsingular iterator i:
@@ -273,7 +273,7 @@ class deque_iterator
{ return x += n; }
};
-} //namespace container_detail {
+} //namespace dtl {
// Deque base class. It has two purposes. First, its constructor
// and destructor allocate (but don't initialize) storage. This makes
@@ -323,8 +323,8 @@ class deque_base
void priv_deallocate_map(ptr_alloc_ptr p, size_type n) BOOST_NOEXCEPT_OR_NOTHROW
{ this->ptr_alloc().deallocate(p, n); }
- typedef container_detail::deque_iterator<val_alloc_ptr, false> iterator;
- typedef container_detail::deque_iterator<val_alloc_ptr, true > const_iterator;
+ typedef dtl::deque_iterator<val_alloc_ptr, false> iterator;
+ typedef dtl::deque_iterator<val_alloc_ptr, true > const_iterator;
deque_base(size_type num_elements, const allocator_type& a)
: members_(a)
@@ -369,7 +369,7 @@ class deque_base
// if(num_elements){
size_type num_nodes = num_elements / s_buffer_size() + 1;
- this->members_.m_map_size = container_detail::max_value((size_type) InitialMapSize, num_nodes + 2);
+ this->members_.m_map_size = dtl::max_value((size_type) InitialMapSize, num_nodes + 2);
this->members_.m_map = this->priv_allocate_map(this->members_.m_map_size);
ptr_alloc_ptr nstart = this->members_.m_map + (this->members_.m_map_size - num_nodes) / 2;
@@ -535,7 +535,7 @@ class deque : protected deque_base<Allocator>
//! <b>Throws</b>: If allocator_type's default constructor throws.
//!
//! <b>Complexity</b>: Constant.
- deque() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ deque() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: Base()
{}
@@ -558,7 +558,7 @@ class deque : protected deque_base<Allocator>
explicit deque(size_type n)
: Base(n, allocator_type())
{
- container_detail::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
proxy.uninitialized_copy_n_and_update(this->alloc(), this->begin(), n);
//deque_base will deallocate in case of exception...
}
@@ -575,7 +575,7 @@ class deque : protected deque_base<Allocator>
deque(size_type n, default_init_t)
: Base(n, allocator_type())
{
- container_detail::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
proxy.uninitialized_copy_n_and_update(this->alloc(), this->begin(), n);
//deque_base will deallocate in case of exception...
}
@@ -590,7 +590,7 @@ class deque : protected deque_base<Allocator>
explicit deque(size_type n, const allocator_type &a)
: Base(n, a)
{
- container_detail::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
proxy.uninitialized_copy_n_and_update(this->alloc(), this->begin(), n);
//deque_base will deallocate in case of exception...
}
@@ -607,7 +607,7 @@ class deque : protected deque_base<Allocator>
deque(size_type n, default_init_t, const allocator_type &a)
: Base(n, a)
{
- container_detail::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
proxy.uninitialized_copy_n_and_update(this->alloc(), this->begin(), n);
//deque_base will deallocate in case of exception...
}
@@ -644,7 +644,7 @@ class deque : protected deque_base<Allocator>
template <class InIt>
deque(InIt first, InIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_convertible
+ , typename dtl::disable_if_convertible
<InIt, size_type>::type * = 0
#endif
)
@@ -663,7 +663,7 @@ class deque : protected deque_base<Allocator>
template <class InIt>
deque(InIt first, InIt last, const allocator_type& a
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_convertible
+ , typename dtl::disable_if_convertible
<InIt, size_type>::type * = 0
#endif
)
@@ -776,14 +776,14 @@ class deque : protected deque_base<Allocator>
if (&x != this){
allocator_type &this_alloc = this->alloc();
const allocator_type &x_alloc = x.alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
this->shrink_to_fit();
}
- container_detail::assign_alloc(this->alloc(), x.alloc(), flag);
- container_detail::assign_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
+ dtl::assign_alloc(this->alloc(), x.alloc(), flag);
+ dtl::assign_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
this->assign(x.cbegin(), x.cend());
}
return *this;
@@ -806,7 +806,7 @@ class deque : protected deque_base<Allocator>
allocator_type &x_alloc = x.alloc();
const bool propagate_alloc = allocator_traits_type::
propagate_on_container_move_assignment::value;
- container_detail::bool_<propagate_alloc> flag;
+ dtl::bool_<propagate_alloc> flag;
const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal;
//Resources can be transferred if both allocators are
//going to be equal after this function (either propagated or already equal)
@@ -814,8 +814,8 @@ class deque : protected deque_base<Allocator>
//Destroy objects but retain memory in case x reuses it in the future
this->clear();
//Move allocator if needed
- container_detail::move_alloc(this_alloc, x_alloc, flag);
- container_detail::move_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
+ dtl::move_alloc(this_alloc, x_alloc, flag);
+ dtl::move_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
//Nothrow swap
this->swap_members(x);
}
@@ -863,10 +863,10 @@ class deque : protected deque_base<Allocator>
template <class InIt>
void assign(InIt first, InIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InIt, size_type>
- , container_detail::is_not_input_iterator<InIt>
+ , dtl::is_convertible<InIt, size_type>
+ , dtl::is_not_input_iterator<InIt>
>::type * = 0
#endif
)
@@ -886,10 +886,10 @@ class deque : protected deque_base<Allocator>
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class FwdIt>
void assign(FwdIt first, FwdIt last
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<FwdIt, size_type>
- , container_detail::is_input_iterator<FwdIt>
+ , dtl::is_convertible<FwdIt, size_type>
+ , dtl::is_input_iterator<FwdIt>
>::type * = 0
)
{
@@ -1096,7 +1096,7 @@ class deque : protected deque_base<Allocator>
this->priv_erase_last_n(len - new_size);
else{
const size_type n = new_size - this->size();
- container_detail::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_value_initialized_n_proxy<Allocator, iterator> proxy;
priv_insert_back_aux_impl(n, proxy);
}
}
@@ -1116,7 +1116,7 @@ class deque : protected deque_base<Allocator>
this->priv_erase_last_n(len - new_size);
else{
const size_type n = new_size - this->size();
- container_detail::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
+ dtl::insert_default_initialized_n_proxy<Allocator, iterator> proxy;
priv_insert_back_aux_impl(n, proxy);
}
}
@@ -1366,7 +1366,7 @@ class deque : protected deque_base<Allocator>
return r;
}
else{
- typedef container_detail::insert_nonmovable_emplace_proxy<Allocator, iterator, Args...> type;
+ typedef dtl::insert_nonmovable_emplace_proxy<Allocator, iterator, Args...> type;
return *this->priv_insert_front_aux_impl(1, type(boost::forward<Args>(args)...));
}
}
@@ -1392,7 +1392,7 @@ class deque : protected deque_base<Allocator>
return r;
}
else{
- typedef container_detail::insert_nonmovable_emplace_proxy<Allocator, iterator, Args...> type;
+ typedef dtl::insert_nonmovable_emplace_proxy<Allocator, iterator, Args...> type;
return *this->priv_insert_back_aux_impl(1, type(boost::forward<Args>(args)...));
}
}
@@ -1419,7 +1419,7 @@ class deque : protected deque_base<Allocator>
return (this->end()-1);
}
else{
- typedef container_detail::insert_emplace_proxy<Allocator, iterator, Args...> type;
+ typedef dtl::insert_emplace_proxy<Allocator, iterator, Args...> type;
return this->priv_insert_aux_impl(p, 1, type(boost::forward<Args>(args)...));
}
}
@@ -1438,7 +1438,7 @@ class deque : protected deque_base<Allocator>
return r;\
}\
else{\
- typedef container_detail::insert_nonmovable_emplace_proxy##N\
+ typedef dtl::insert_nonmovable_emplace_proxy##N\
<Allocator, iterator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
return *priv_insert_front_aux_impl(1, type(BOOST_MOVE_FWD##N));\
}\
@@ -1455,7 +1455,7 @@ class deque : protected deque_base<Allocator>
return r;\
}\
else{\
- typedef container_detail::insert_nonmovable_emplace_proxy##N\
+ typedef dtl::insert_nonmovable_emplace_proxy##N\
<Allocator, iterator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
return *priv_insert_back_aux_impl(1, type(BOOST_MOVE_FWD##N));\
}\
@@ -1474,7 +1474,7 @@ class deque : protected deque_base<Allocator>
return (--this->end());\
}\
else{\
- typedef container_detail::insert_emplace_proxy_arg##N\
+ typedef dtl::insert_emplace_proxy_arg##N\
<Allocator, iterator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
return this->priv_insert_aux_impl(p, 1, type(BOOST_MOVE_FWD##N));\
}\
@@ -1583,10 +1583,10 @@ class deque : protected deque_base<Allocator>
template <class InIt>
iterator insert(const_iterator pos, InIt first, InIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InIt, size_type>
- , container_detail::is_not_input_iterator<InIt>
+ , dtl::is_convertible<InIt, size_type>
+ , dtl::is_not_input_iterator<InIt>
>::type * = 0
#endif
)
@@ -1624,16 +1624,16 @@ class deque : protected deque_base<Allocator>
template <class FwdIt>
iterator insert(const_iterator p, FwdIt first, FwdIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<FwdIt, size_type>
- , container_detail::is_input_iterator<FwdIt>
+ , dtl::is_convertible<FwdIt, size_type>
+ , dtl::is_input_iterator<FwdIt>
>::type * = 0
#endif
)
{
BOOST_ASSERT(this->priv_in_range_or_end(p));
- container_detail::insert_range_proxy<Allocator, FwdIt, iterator> proxy(first);
+ dtl::insert_range_proxy<Allocator, FwdIt, iterator> proxy(first);
return priv_insert_aux_impl(p, boost::container::iterator_distance(first, last), proxy);
}
#endif
@@ -1748,9 +1748,9 @@ class deque : protected deque_base<Allocator>
|| allocator_traits_type::is_always_equal::value)
{
this->swap_members(x);
- container_detail::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
- container_detail::swap_alloc(this->alloc(), x.alloc(), flag);
- container_detail::swap_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
+ dtl::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
+ dtl::swap_alloc(this->alloc(), x.alloc(), flag);
+ dtl::swap_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
}
//! <b>Effects</b>: Erases all the elements of the deque.
@@ -1874,7 +1874,7 @@ class deque : protected deque_base<Allocator>
else {
return priv_insert_aux_impl
( p, (size_type)1
- , container_detail::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
+ , dtl::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
}
}
@@ -1889,7 +1889,7 @@ class deque : protected deque_base<Allocator>
else{
priv_insert_aux_impl
( this->cbegin(), (size_type)1
- , container_detail::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
+ , dtl::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
}
}
@@ -1904,7 +1904,7 @@ class deque : protected deque_base<Allocator>
else{
priv_insert_aux_impl
( this->cend(), (size_type)1
- , container_detail::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
+ , dtl::get_insert_value_proxy<iterator, Allocator>(::boost::forward<U>(x)));
}
}
@@ -2220,7 +2220,7 @@ class deque : protected deque_base<Allocator>
}
else {
size_type new_map_size =
- this->members_.m_map_size + container_detail::max_value(this->members_.m_map_size, nodes_to_add) + 2;
+ this->members_.m_map_size + dtl::max_value(this->members_.m_map_size, nodes_to_add) + 2;
index_pointer new_map = this->priv_allocate_map(new_map_size);
new_nstart = new_map + (new_map_size - new_num_nodes) / 2
diff --git a/boost/container/detail/adaptive_node_pool.hpp b/boost/container/detail/adaptive_node_pool.hpp
index 20696100f5..33bfcc98a7 100644
--- a/boost/container/detail/adaptive_node_pool.hpp
+++ b/boost/container/detail/adaptive_node_pool.hpp
@@ -37,12 +37,12 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<bool AlignOnly>
struct select_private_adaptive_node_pool_impl
{
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
private_adaptive_node_pool_impl
< fake_segment_manager
, unsigned(AlignOnly)*::boost::container::adaptive_pool_flag::align_only
@@ -157,7 +157,7 @@ class shared_adaptive_node_pool
default_mutex mutex_;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/adaptive_node_pool_impl.hpp b/boost/container/detail/adaptive_node_pool_impl.hpp
index 54db19dff2..9ff4ec5371 100644
--- a/boost/container/detail/adaptive_node_pool_impl.hpp
+++ b/boost/container/detail/adaptive_node_pool_impl.hpp
@@ -55,7 +55,7 @@ static const unsigned int address_ordered = 1u << 2u;
} //namespace adaptive_pool_flag{
-namespace container_detail {
+namespace dtl {
template<class size_type>
struct hdr_offset_holder_t
@@ -876,7 +876,7 @@ class private_adaptive_node_pool_impl
size_type m_totally_free_blocks; //Free blocks
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/addressof.hpp b/boost/container/detail/addressof.hpp
index fedbdb91d1..b3b8a4dd6f 100644
--- a/boost/container/detail/addressof.hpp
+++ b/boost/container/detail/addressof.hpp
@@ -22,7 +22,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template <typename T>
BOOST_CONTAINER_FORCEINLINE T* addressof(T& obj)
@@ -34,7 +34,7 @@ BOOST_CONTAINER_FORCEINLINE T* addressof(T& obj)
)));
}
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/advanced_insert_int.hpp b/boost/container/detail/advanced_insert_int.hpp
index db5e8df252..d9cba4858b 100644
--- a/boost/container/detail/advanced_insert_int.hpp
+++ b/boost/container/detail/advanced_insert_int.hpp
@@ -41,7 +41,7 @@
#include <boost/assert.hpp>
#include <boost/core/no_exceptions_support.hpp>
-namespace boost { namespace container { namespace container_detail {
+namespace boost { namespace container { namespace dtl {
template<class Allocator, class FwdIt, class Iterator>
struct move_insert_range_proxy
@@ -208,7 +208,7 @@ insert_copy_proxy<Allocator, It> get_insert_value_proxy(const typename boost::co
return insert_copy_proxy<Allocator, It>(v);
}
-}}} //namespace boost { namespace container { namespace container_detail {
+}}} //namespace boost { namespace container { namespace dtl {
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
@@ -217,7 +217,7 @@ insert_copy_proxy<Allocator, It> get_insert_value_proxy(const typename boost::co
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class Allocator, class Iterator, class ...Args>
struct insert_nonmovable_emplace_proxy
@@ -271,7 +271,7 @@ struct insert_emplace_proxy
{
BOOST_ASSERT(n ==1); (void)n;
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type *vp = static_cast<value_type *>(static_cast<void *>(&v));
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(v.data));
alloc_traits::construct(a, vp,
::boost::forward<Args>(get<IdxPack>(this->args_))...);
BOOST_TRY{
@@ -301,7 +301,7 @@ struct insert_emplace_proxy<Allocator, Iterator, typename boost::container::allo
//Any problem is solvable with an extra layer of indirection? ;-)
template<class Allocator, class Iterator>
struct insert_emplace_proxy<Allocator, Iterator
- , typename boost::container::container_detail::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type
+ , typename boost::container::dtl::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type
>
: public insert_copy_proxy<Allocator, Iterator>
{
@@ -321,7 +321,7 @@ struct insert_emplace_proxy<Allocator, Iterator, typename boost::container::allo
template<class Allocator, class Iterator>
struct insert_emplace_proxy<Allocator, Iterator
- , typename boost::container::container_detail::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type &
+ , typename boost::container::dtl::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type &
>
: public insert_copy_proxy<Allocator, Iterator>
{
@@ -330,7 +330,7 @@ struct insert_emplace_proxy<Allocator, Iterator
{}
};
-}}} //namespace boost { namespace container { namespace container_detail {
+}}} //namespace boost { namespace container { namespace dtl {
#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
@@ -338,7 +338,7 @@ struct insert_emplace_proxy<Allocator, Iterator
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
#define BOOST_CONTAINER_ADVANCED_INSERT_INT_CODE(N) \
template< class Allocator, class Iterator BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
@@ -382,7 +382,7 @@ struct insert_emplace_proxy_arg##N\
BOOST_ASSERT(n == 1); (void)n;\
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;\
BOOST_ASSERT((((size_type)(&v)) % alignment_of<value_type>::value) == 0);\
- value_type *vp = static_cast<value_type *>(static_cast<void *>(&v));\
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(v.data));\
alloc_traits::construct(a, vp BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
BOOST_TRY{\
*p = ::boost::move(*vp);\
@@ -437,7 +437,7 @@ struct insert_emplace_proxy_arg1<Allocator, Iterator, typename boost::container:
//Any problem is solvable with an extra layer of indirection? ;-)
template<class Allocator, class Iterator>
struct insert_emplace_proxy_arg1<Allocator, Iterator
- , typename boost::container::container_detail::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type
+ , typename boost::container::dtl::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type
>
: public insert_copy_proxy<Allocator, Iterator>
{
@@ -457,7 +457,7 @@ struct insert_emplace_proxy_arg1<Allocator, Iterator, typename boost::container:
template<class Allocator, class Iterator>
struct insert_emplace_proxy_arg1<Allocator, Iterator
- , typename boost::container::container_detail::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type &
+ , typename boost::container::dtl::add_const<typename boost::container::allocator_traits<Allocator>::value_type>::type &
>
: public insert_copy_proxy<Allocator, Iterator>
{
@@ -468,7 +468,7 @@ struct insert_emplace_proxy_arg1<Allocator, Iterator
#endif
-}}} //namespace boost { namespace container { namespace container_detail {
+}}} //namespace boost { namespace container { namespace dtl {
#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
diff --git a/boost/container/detail/alloc_helpers.hpp b/boost/container/detail/alloc_helpers.hpp
index 656e0c2a5e..57c59e46c1 100644
--- a/boost/container/detail/alloc_helpers.hpp
+++ b/boost/container/detail/alloc_helpers.hpp
@@ -24,36 +24,36 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class AllocatorType>
-inline void swap_alloc(AllocatorType &, AllocatorType &, container_detail::false_type)
+inline void swap_alloc(AllocatorType &, AllocatorType &, dtl::false_type)
BOOST_NOEXCEPT_OR_NOTHROW
{}
template<class AllocatorType>
-inline void swap_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type)
+inline void swap_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type)
{ boost::adl_move_swap(l, r); }
template<class AllocatorType>
-inline void assign_alloc(AllocatorType &, const AllocatorType &, container_detail::false_type)
+inline void assign_alloc(AllocatorType &, const AllocatorType &, dtl::false_type)
BOOST_NOEXCEPT_OR_NOTHROW
{}
template<class AllocatorType>
-inline void assign_alloc(AllocatorType &l, const AllocatorType &r, container_detail::true_type)
+inline void assign_alloc(AllocatorType &l, const AllocatorType &r, dtl::true_type)
{ l = r; }
template<class AllocatorType>
-inline void move_alloc(AllocatorType &, AllocatorType &, container_detail::false_type)
+inline void move_alloc(AllocatorType &, AllocatorType &, dtl::false_type)
BOOST_NOEXCEPT_OR_NOTHROW
{}
template<class AllocatorType>
-inline void move_alloc(AllocatorType &l, AllocatorType &r, container_detail::true_type)
+inline void move_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type)
{ l = ::boost::move(r); }
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/allocator_version_traits.hpp b/boost/container/detail/allocator_version_traits.hpp
index 62492da091..18460bdf08 100644
--- a/boost/container/detail/allocator_version_traits.hpp
+++ b/boost/container/detail/allocator_version_traits.hpp
@@ -33,12 +33,12 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
-template<class Allocator, unsigned Version = boost::container::container_detail::version<Allocator>::value>
+template<class Allocator, unsigned Version = boost::container::dtl::version<Allocator>::value>
struct allocator_version_traits
{
- typedef ::boost::container::container_detail::integral_constant
+ typedef ::boost::container::dtl::integral_constant
<unsigned, Version> alloc_version;
typedef typename Allocator::multiallocation_chain multiallocation_chain;
@@ -67,7 +67,7 @@ struct allocator_version_traits
template<class Allocator>
struct allocator_version_traits<Allocator, 1>
{
- typedef ::boost::container::container_detail::integral_constant
+ typedef ::boost::container::dtl::integral_constant
<unsigned, 1> alloc_version;
typedef typename boost::container::allocator_traits<Allocator>::pointer pointer;
@@ -76,9 +76,9 @@ struct allocator_version_traits<Allocator, 1>
typedef typename boost::intrusive::pointer_traits<pointer>::
template rebind_pointer<void>::type void_ptr;
- typedef container_detail::basic_multiallocation_chain
+ typedef dtl::basic_multiallocation_chain
<void_ptr> multialloc_cached_counted;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
transform_multiallocation_chain
< multialloc_cached_counted, value_type> multiallocation_chain;
@@ -153,7 +153,7 @@ struct allocator_version_traits<Allocator, 1>
}
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/construct_in_place.hpp b/boost/container/detail/construct_in_place.hpp
index 9fecd24a8f..b131f06a86 100644
--- a/boost/container/detail/construct_in_place.hpp
+++ b/boost/container/detail/construct_in_place.hpp
@@ -67,7 +67,7 @@ BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, InpIt source)
template<class DstIt, class U, class D>
BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, value_init_construct_iterator<U, D>)
{
- container_detail::value_init<U> val;
+ dtl::value_init<U> val;
*dest = boost::move(val.get());
}
diff --git a/boost/container/detail/container_or_allocator_rebind.hpp b/boost/container/detail/container_or_allocator_rebind.hpp
index c60d1c0c50..d74df6c966 100644
--- a/boost/container/detail/container_or_allocator_rebind.hpp
+++ b/boost/container/detail/container_or_allocator_rebind.hpp
@@ -24,7 +24,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class AllocatorOrContainer, class ToType, bool = is_container<AllocatorOrContainer>::value>
struct container_or_allocator_rebind_impl
@@ -42,7 +42,7 @@ struct container_or_allocator_rebind
: container_or_allocator_rebind_impl<AllocatorOrContainer, ToType>
{};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/container_rebind.hpp b/boost/container/detail/container_rebind.hpp
index 79ad9d7739..0ebb4789e4 100644
--- a/boost/container/detail/container_rebind.hpp
+++ b/boost/container/detail/container_rebind.hpp
@@ -23,7 +23,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template <class Cont, class U>
struct container_rebind;
@@ -251,7 +251,7 @@ namespace container_detail {
#endif //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/copy_move_algo.hpp b/boost/container/detail/copy_move_algo.hpp
index 5293260091..cc87e4abc0 100644
--- a/boost/container/detail/copy_move_algo.hpp
+++ b/boost/container/detail/copy_move_algo.hpp
@@ -38,7 +38,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class I>
struct are_elements_contiguous
@@ -65,17 +65,15 @@ struct are_elements_contiguous< ::boost::move_iterator<It> >
: are_elements_contiguous<It>
{};
+} //namespace dtl {
+
/////////////////////////
// predeclarations
/////////////////////////
-template<class Pointer>
-class vector_iterator;
-
-template<class Pointer>
-class vector_const_iterator;
+template <class Pointer, bool IsConst>
+class vec_iterator;
-} //namespace container_detail {
} //namespace container {
namespace interprocess {
@@ -87,20 +85,14 @@ class offset_ptr;
namespace container {
-namespace container_detail {
+namespace dtl {
/////////////////////////
//vector_[const_]iterator
/////////////////////////
-template<class Pointer>
-struct are_elements_contiguous<boost::container::container_detail::vector_iterator<Pointer> >
-{
- static const bool value = true;
-};
-
-template<class Pointer>
-struct are_elements_contiguous<boost::container::container_detail::vector_const_iterator<Pointer> >
+template <class Pointer, bool IsConst>
+struct are_elements_contiguous<boost::container::vec_iterator<Pointer, IsConst> >
{
static const bool value = true;
};
@@ -130,7 +122,7 @@ template <typename I, typename O>
struct is_memtransfer_copy_assignable
: boost::move_detail::and_
< are_contiguous_and_same<I, O>
- , container_detail::is_trivially_copy_assignable< typename ::boost::container::iterator_traits<I>::value_type >
+ , dtl::is_trivially_copy_assignable< typename ::boost::container::iterator_traits<I>::value_type >
>
{};
@@ -138,28 +130,28 @@ template <typename I, typename O>
struct is_memtransfer_copy_constructible
: boost::move_detail::and_
< are_contiguous_and_same<I, O>
- , container_detail::is_trivially_copy_constructible< typename ::boost::container::iterator_traits<I>::value_type >
+ , dtl::is_trivially_copy_constructible< typename ::boost::container::iterator_traits<I>::value_type >
>
{};
template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_constructible
- : enable_if<container_detail::is_memtransfer_copy_constructible<I, O>, R>
+ : enable_if<dtl::is_memtransfer_copy_constructible<I, O>, R>
{};
template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_constructible
- : disable_if<container_detail::is_memtransfer_copy_constructible<I, O>, R>
+ : disable_if<dtl::is_memtransfer_copy_constructible<I, O>, R>
{};
template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_assignable
- : enable_if<container_detail::is_memtransfer_copy_assignable<I, O>, R>
+ : enable_if<dtl::is_memtransfer_copy_assignable<I, O>, R>
{};
template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_assignable
- : disable_if<container_detail::is_memtransfer_copy_assignable<I, O>, R>
+ : disable_if<dtl::is_memtransfer_copy_assignable<I, O>, R>
{};
template
@@ -224,44 +216,44 @@ struct is_memzero_initializable
{
typedef typename ::boost::container::iterator_traits<O>::value_type value_type;
static const bool value = are_elements_contiguous<O>::value &&
- ( container_detail::is_integral<value_type>::value || container_detail::is_enum<value_type>::value
+ ( dtl::is_integral<value_type>::value || dtl::is_enum<value_type>::value
#if defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL)
- || container_detail::is_pointer<value_type>::value
+ || dtl::is_pointer<value_type>::value
#endif
#if defined(BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO)
- || container_detail::is_floating_point<value_type>::value
+ || dtl::is_floating_point<value_type>::value
#endif
#if defined(BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO) && defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL)
- || container_detail::is_pod<value_type>::value
+ || dtl::is_pod<value_type>::value
#endif
);
};
template <typename O, typename R>
struct enable_if_memzero_initializable
- : enable_if_c<container_detail::is_memzero_initializable<O>::value, R>
+ : enable_if_c<dtl::is_memzero_initializable<O>::value, R>
{};
template <typename O, typename R>
struct disable_if_memzero_initializable
- : enable_if_c<!container_detail::is_memzero_initializable<O>::value, R>
+ : enable_if_c<!dtl::is_memzero_initializable<O>::value, R>
{};
template <typename I, typename R>
struct enable_if_trivially_destructible
- : enable_if_c < container_detail::is_trivially_destructible
+ : enable_if_c < dtl::is_trivially_destructible
<typename boost::container::iterator_traits<I>::value_type>::value
, R>
{};
template <typename I, typename R>
struct disable_if_trivially_destructible
- : enable_if_c <!container_detail::is_trivially_destructible
+ : enable_if_c <!dtl::is_trivially_destructible
<typename boost::container::iterator_traits<I>::value_type>::value
, R>
{};
-} //namespace container_detail {
+} //namespace dtl {
//////////////////////////////////////////////////////////////////////////////
//
@@ -281,7 +273,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_move_alloc(Allocator &a, I f, I l, F r)
{
F back = r;
@@ -305,9 +297,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_move_alloc(Allocator &, I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove(f, l, r); }
+{ return dtl::memmove(f, l, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -326,7 +318,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_move_alloc_n(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
F back = r;
@@ -350,9 +342,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_move_alloc_n(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n(f, n, r); }
+{ return dtl::memmove_n(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -371,7 +363,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, I>::type
uninitialized_move_alloc_n_source(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
F back = r;
@@ -395,9 +387,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, I>::type
uninitialized_move_alloc_n_source(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source(f, n, r); }
+{ return dtl::memmove_n_source(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -416,7 +408,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_copy_alloc(Allocator &a, I f, I l, F r)
{
F back = r;
@@ -440,9 +432,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_copy_alloc(Allocator &, I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove(f, l, r); }
+{ return dtl::memmove(f, l, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -461,7 +453,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_copy_alloc_n(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
F back = r;
@@ -485,9 +477,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, F>::type
uninitialized_copy_alloc_n(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n(f, n, r); }
+{ return dtl::memmove_n(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -506,7 +498,7 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_constructible<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_constructible<I, F, I>::type
uninitialized_copy_alloc_n_source(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
F back = r;
@@ -530,9 +522,9 @@ template
<typename Allocator,
typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_constructible<I, F, I>::type
uninitialized_copy_alloc_n_source(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source(f, n, r); }
+{ return dtl::memmove_n_source(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -550,7 +542,7 @@ inline typename container_detail::enable_if_memtransfer_copy_constructible<I, F,
template
<typename Allocator,
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memzero_initializable<F, F>::type
+inline typename dtl::disable_if_memzero_initializable<F, F>::type
uninitialized_value_init_alloc_n(Allocator &a, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
F back = r;
@@ -573,7 +565,7 @@ inline typename container_detail::disable_if_memzero_initializable<F, F>::type
template
<typename Allocator,
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memzero_initializable<F, F>::type
+inline typename dtl::enable_if_memzero_initializable<F, F>::type
uninitialized_value_init_alloc_n(Allocator &, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
typedef typename boost::container::iterator_traits<F>::value_type value_type;
@@ -698,7 +690,7 @@ inline F uninitialized_fill_alloc_n(Allocator &a, const T &v, typename boost::co
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, F>::type
copy(I f, I l, F r)
{
while (f != l) {
@@ -711,9 +703,9 @@ inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, F>::type
copy(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove(f, l, r); }
+{ return dtl::memmove(f, l, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -725,7 +717,7 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, F>::type
copy_n(I f, U n, F r)
{
while (n--) {
@@ -739,9 +731,9 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, F>::type
copy_n(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n(f, n, r); }
+{ return dtl::memmove_n(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -753,7 +745,7 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, I>::type
copy_n_source(I f, U n, F r)
{
while (n--) {
@@ -767,9 +759,9 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, I>::type
copy_n_source(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source(f, n, r); }
+{ return dtl::memmove_n_source(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -781,7 +773,7 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, I>::type
copy_n_source_dest(I f, U n, F &r)
{
while (n--) {
@@ -795,9 +787,9 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, I>::type
copy_n_source_dest(I f, U n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source_dest(f, n, r); }
+{ return dtl::memmove_n_source_dest(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -808,7 +800,7 @@ inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, I>
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, F>::type
move(I f, I l, F r)
{
while (f != l) {
@@ -821,9 +813,9 @@ inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, F>::type
move(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove(f, l, r); }
+{ return dtl::memmove(f, l, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -835,7 +827,7 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, F>::type
move_n(I f, U n, F r)
{
while (n--) {
@@ -849,9 +841,9 @@ template
<typename I, // I models InputIterator
typename U, // U models unsigned integral constant
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, F>::type
move_n(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n(f, n, r); }
+{ return dtl::memmove_n(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
@@ -863,7 +855,7 @@ inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>
template
<typename I, // I models BidirectionalIterator
typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, F>::type
move_backward(I f, I l, F r)
{
while (f != l) {
@@ -876,7 +868,7 @@ inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, F
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, F>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, F>::type
move_backward(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
typedef typename boost::container::iterator_traits<I>::value_type value_type;
@@ -896,7 +888,7 @@ template
<typename I // I models InputIterator
,typename U // U models unsigned integral constant
,typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, I>::type
move_n_source_dest(I f, U n, F &r)
{
while (n--) {
@@ -910,9 +902,9 @@ template
<typename I // I models InputIterator
,typename U // U models unsigned integral constant
,typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, I>::type
move_n_source_dest(I f, U n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source_dest(f, n, r); }
+{ return dtl::memmove_n_source_dest(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -924,7 +916,7 @@ template
<typename I // I models InputIterator
,typename U // U models unsigned integral constant
,typename F> // F models ForwardIterator
-inline typename container_detail::disable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<I, F, I>::type
move_n_source(I f, U n, F r)
{
while (n--) {
@@ -938,9 +930,9 @@ template
<typename I // I models InputIterator
,typename U // U models unsigned integral constant
,typename F> // F models ForwardIterator
-inline typename container_detail::enable_if_memtransfer_copy_assignable<I, F, I>::type
+inline typename dtl::enable_if_memtransfer_copy_assignable<I, F, I>::type
move_n_source(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
-{ return container_detail::memmove_n_source(f, n, r); }
+{ return dtl::memmove_n_source(f, n, r); }
//////////////////////////////////////////////////////////////////////////////
//
@@ -952,7 +944,7 @@ template
<typename Allocator
,typename I // I models InputIterator
,typename U> // U models unsigned integral constant
-inline typename container_detail::disable_if_trivially_destructible<I, void>::type
+inline typename dtl::disable_if_trivially_destructible<I, void>::type
destroy_alloc_n(Allocator &a, I f, U n)
{
while(n){
@@ -966,7 +958,7 @@ template
<typename Allocator
,typename I // I models InputIterator
,typename U> // U models unsigned integral constant
-inline typename container_detail::enable_if_trivially_destructible<I, void>::type
+inline typename dtl::enable_if_trivially_destructible<I, void>::type
destroy_alloc_n(Allocator &, I, U)
{}
@@ -982,7 +974,7 @@ template
,typename F // F models ForwardIterator
,typename G // G models ForwardIterator
>
-inline typename container_detail::disable_if_memtransfer_copy_assignable<F, G, void>::type
+inline typename dtl::disable_if_memtransfer_copy_assignable<F, G, void>::type
deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
, G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
@@ -1002,21 +994,21 @@ template
,typename F // F models ForwardIterator
,typename G // G models ForwardIterator
>
-inline typename container_detail::enable_if_c
- < container_detail::is_memtransfer_copy_assignable<F, G>::value && (MaxTmpBytes <= DeepSwapAllocNMaxStorage) && false
+inline typename dtl::enable_if_c
+ < dtl::is_memtransfer_copy_assignable<F, G>::value && (MaxTmpBytes <= DeepSwapAllocNMaxStorage) && false
, void>::type
deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
, G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
typedef typename allocator_traits<Allocator>::value_type value_type;
- typedef typename container_detail::aligned_storage
- <MaxTmpBytes, container_detail::alignment_of<value_type>::value>::type storage_type;
+ typedef typename dtl::aligned_storage
+ <MaxTmpBytes, dtl::alignment_of<value_type>::value>::type storage_type;
storage_type storage;
const std::size_t n_i_bytes = sizeof(value_type)*n_i;
void *const large_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f));
void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
- void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage));
+ void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
std::memcpy(stora_ptr, large_ptr, n_i_bytes);
std::memcpy(large_ptr, short_ptr, n_i_bytes);
std::memcpy(short_ptr, stora_ptr, n_i_bytes);
@@ -1032,22 +1024,22 @@ template
,typename F // F models ForwardIterator
,typename G // G models ForwardIterator
>
-inline typename container_detail::enable_if_c
- < container_detail::is_memtransfer_copy_assignable<F, G>::value && true//(MaxTmpBytes > DeepSwapAllocNMaxStorage)
+inline typename dtl::enable_if_c
+ < dtl::is_memtransfer_copy_assignable<F, G>::value && true//(MaxTmpBytes > DeepSwapAllocNMaxStorage)
, void>::type
deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
, G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
typedef typename allocator_traits<Allocator>::value_type value_type;
- typedef typename container_detail::aligned_storage
- <DeepSwapAllocNMaxStorage, container_detail::alignment_of<value_type>::value>::type storage_type;
+ typedef typename dtl::aligned_storage
+ <DeepSwapAllocNMaxStorage, dtl::alignment_of<value_type>::value>::type storage_type;
storage_type storage;
const std::size_t sizeof_storage = sizeof(storage);
std::size_t n_i_bytes = sizeof(value_type)*n_i;
char *large_ptr = static_cast<char*>(static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f)));
char *short_ptr = static_cast<char*>(static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f)));
- char *stora_ptr = static_cast<char*>(static_cast<void*>(&storage));
+ char *stora_ptr = static_cast<char*>(static_cast<void*>(storage.data));
std::size_t szt_times = n_i_bytes/sizeof_storage;
const std::size_t szt_rem = n_i_bytes%sizeof_storage;
diff --git a/boost/container/detail/destroyers.hpp b/boost/container/detail/destroyers.hpp
index c3a5d90af3..9b0be44e66 100644
--- a/boost/container/detail/destroyers.hpp
+++ b/boost/container/detail/destroyers.hpp
@@ -30,7 +30,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
//!A deleter for scoped_ptr that deallocates the memory
//!allocated for an object using a STL allocator.
@@ -39,8 +39,8 @@ struct scoped_deallocator
{
typedef allocator_traits<Allocator> allocator_traits_type;
typedef typename allocator_traits_type::pointer pointer;
- typedef container_detail::integral_constant<unsigned,
- boost::container::container_detail::
+ typedef dtl::integral_constant<unsigned,
+ boost::container::dtl::
version<Allocator>::value> alloc_version;
private:
@@ -142,8 +142,8 @@ struct scoped_destroy_deallocator
typedef boost::container::allocator_traits<Allocator> AllocTraits;
typedef typename AllocTraits::pointer pointer;
typedef typename AllocTraits::size_type size_type;
- typedef container_detail::integral_constant<unsigned,
- boost::container::container_detail::
+ typedef dtl::integral_constant<unsigned,
+ boost::container::dtl::
version<Allocator>::value> alloc_version;
scoped_destroy_deallocator(pointer p, Allocator& a)
@@ -296,8 +296,8 @@ class allocator_destroyer
typedef boost::container::allocator_traits<Allocator> AllocTraits;
typedef typename AllocTraits::value_type value_type;
typedef typename AllocTraits::pointer pointer;
- typedef container_detail::integral_constant<unsigned,
- boost::container::container_detail::
+ typedef dtl::integral_constant<unsigned,
+ boost::container::dtl::
version<Allocator>::value> alloc_version;
private:
@@ -369,7 +369,7 @@ class allocator_multialloc_chain_node_deallocator
}
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/dispatch_uses_allocator.hpp b/boost/container/detail/dispatch_uses_allocator.hpp
index 946fdf615b..0b8cfea66c 100644
--- a/boost/container/detail/dispatch_uses_allocator.hpp
+++ b/boost/container/detail/dispatch_uses_allocator.hpp
@@ -35,7 +35,7 @@
namespace boost { namespace container {
-namespace container_detail {
+namespace dtl {
// Check if we can detect is_convertible using advanced SFINAE expressions
@@ -110,10 +110,10 @@ template < typename ConstructAlloc
, typename T
, class ...Args
>
-inline typename container_detail::enable_if_and
+inline typename dtl::enable_if_and
< void
- , container_detail::is_not_pair<T>
- , container_detail::not_< uses_allocator<T, ArgAlloc> >
+ , dtl::is_not_pair<T>
+ , dtl::not_< uses_allocator<T, ArgAlloc> >
>::type dispatch_uses_allocator
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
{
@@ -127,9 +127,9 @@ template < typename ConstructAlloc
, typename T
, class ...Args
>
-inline typename container_detail::enable_if_and
+inline typename dtl::enable_if_and
< void
- , container_detail::is_not_pair<T>
+ , dtl::is_not_pair<T>
, uses_allocator<T, ArgAlloc>
, is_constructible_with_allocator_prefix<T, ArgAlloc, Args...>
>::type dispatch_uses_allocator
@@ -146,11 +146,11 @@ template < typename ConstructAlloc
, typename T
, class ...Args
>
-inline typename container_detail::enable_if_and
+inline typename dtl::enable_if_and
< void
- , container_detail::is_not_pair<T>
+ , dtl::is_not_pair<T>
, uses_allocator<T, ArgAlloc>
- , container_detail::not_<is_constructible_with_allocator_prefix<T, ArgAlloc, Args...> >
+ , dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc, Args...> >
>::type dispatch_uses_allocator
( ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
{
@@ -162,10 +162,10 @@ inline typename container_detail::enable_if_and
#define BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE(N) \
template <typename ConstructAlloc, typename ArgAlloc, typename T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- inline typename container_detail::enable_if_and\
+ inline typename dtl::enable_if_and\
< void\
- , container_detail::is_not_pair<T>\
- , container_detail::not_<uses_allocator<T, ArgAlloc> >\
+ , dtl::is_not_pair<T>\
+ , dtl::not_<uses_allocator<T, ArgAlloc> >\
>::type\
dispatch_uses_allocator\
(ConstructAlloc &construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
@@ -179,9 +179,9 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR
#define BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE(N) \
template < typename ConstructAlloc, typename ArgAlloc, typename T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- inline typename container_detail::enable_if_and\
+ inline typename dtl::enable_if_and\
< void\
- , container_detail::is_not_pair<T>\
+ , dtl::is_not_pair<T>\
, uses_allocator<T, ArgAlloc>\
, is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
>::type\
@@ -197,11 +197,11 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR
#define BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE(N) \
template < typename ConstructAlloc, typename ArgAlloc, typename T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- inline typename container_detail::enable_if_and\
+ inline typename dtl::enable_if_and\
< void\
- , container_detail::is_not_pair<T>\
+ , dtl::is_not_pair<T>\
, uses_allocator<T, ArgAlloc>\
- , container_detail::not_<is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
+ , dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
>::type\
dispatch_uses_allocator\
(ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
@@ -219,18 +219,18 @@ template < typename ConstructAlloc
, typename ArgAlloc
, typename Pair
> inline
-BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if<container_detail::is_pair<Pair> >::type)
+BOOST_CONTAINER_DOC1ST(void, typename dtl::enable_if<dtl::is_pair<Pair> >::type)
dispatch_uses_allocator
( ConstructAlloc & construct_alloc
, BOOST_FWD_REF(ArgAlloc) arg_alloc
, Pair* p)
{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->first));
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->first));
BOOST_TRY{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->second));
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->second));
}
BOOST_CATCH(...) {
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(p->first));
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(p->first));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -240,18 +240,18 @@ BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if<container_deta
template < typename ConstructAlloc
, typename ArgAlloc
, class Pair, class U, class V>
-BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if<container_detail::is_pair<Pair> >::type)
+BOOST_CONTAINER_DOC1ST(void, typename dtl::enable_if<dtl::is_pair<Pair> >::type)
dispatch_uses_allocator
( ConstructAlloc & construct_alloc
, BOOST_FWD_REF(ArgAlloc) arg_alloc
, Pair* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->first), ::boost::forward<U>(x));
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->first), ::boost::forward<U>(x));
BOOST_TRY{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->second), ::boost::forward<V>(y));
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->second), ::boost::forward<V>(y));
}
BOOST_CATCH(...){
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(p->first));
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(p->first));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -260,7 +260,7 @@ BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if<container_deta
template < typename ConstructAlloc
, typename ArgAlloc
, class Pair, class Pair2>
-BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if< container_detail::is_pair<Pair> >::type)
+BOOST_CONTAINER_DOC1ST(void, typename dtl::enable_if< dtl::is_pair<Pair> >::type)
dispatch_uses_allocator
(ConstructAlloc & construct_alloc
, BOOST_FWD_REF(ArgAlloc) arg_alloc
@@ -270,10 +270,10 @@ BOOST_CONTAINER_DOC1ST(void, typename container_detail::enable_if< container_det
template < typename ConstructAlloc
, typename ArgAlloc
, class Pair, class Pair2>
-typename container_detail::enable_if_and
+typename dtl::enable_if_and
< void
- , container_detail::is_pair<Pair>
- , container_detail::not_<boost::move_detail::is_reference<Pair2> > >::type //This is needed for MSVC10 and ambiguous overloads
+ , dtl::is_pair<Pair>
+ , dtl::not_<boost::move_detail::is_reference<Pair2> > >::type //This is needed for MSVC10 and ambiguous overloads
dispatch_uses_allocator
(ConstructAlloc & construct_alloc
, BOOST_FWD_REF(ArgAlloc) arg_alloc
@@ -286,20 +286,20 @@ typename container_detail::enable_if_and
template< typename ConstructAlloc, typename ArgAlloc, class Pair \
, template<class, class, class, class, class, class, class, class, class, class> class BoostTuple \
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
-typename container_detail::enable_if< container_detail::is_pair<Pair> >::type\
+typename dtl::enable_if< dtl::is_pair<Pair> >::type\
dispatch_uses_allocator( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* pair, piecewise_construct_t\
, BoostTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> p\
, BoostTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::boost::tuples::null_type)> q)\
{\
(void)p; (void)q;\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_TMPL_GET##N);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_TMPL_GET##N);\
BOOST_TRY{\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_TMPL_GETQ##M);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_TMPL_GETQ##M);\
}\
BOOST_CATCH(...) {\
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(pair->first));\
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(pair->first));\
BOOST_RETHROW\
}\
BOOST_CATCH_END\
@@ -317,12 +317,12 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
, Tuple<Args1...>& t1, Tuple<Args2...>& t2, index_tuple<Indexes1...>, index_tuple<Indexes2...>)
{
(void)t1; (void)t2;
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(pair->first), ::boost::forward<Args1>(get<Indexes1>(t1))...);
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(pair->first), ::boost::forward<Args1>(get<Indexes1>(t1))...);
BOOST_TRY{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(pair->second), ::boost::forward<Args2>(get<Indexes2>(t2))...);
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(pair->second), ::boost::forward<Args2>(get<Indexes2>(t2))...);
}
BOOST_CATCH(...){
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(pair->first));
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(pair->first));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -330,7 +330,7 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
template< typename ConstructAlloc, typename ArgAlloc, class Pair
, template<class ...> class Tuple, class... Args1, class... Args2>
- typename container_detail::enable_if< container_detail::is_pair<Pair> >::type
+ typename dtl::enable_if< dtl::is_pair<Pair> >::type
dispatch_uses_allocator( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* pair, piecewise_construct_t
, Tuple<Args1...> t1, Tuple<Args2...> t2)
{
@@ -346,20 +346,20 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
template< typename ConstructAlloc, typename ArgAlloc, class Pair\
, template<class, class, class, class, class, class, class, class, class, class> class StdTuple\
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
- typename container_detail::enable_if< container_detail::is_pair<Pair> >::type\
+ typename dtl::enable_if< dtl::is_pair<Pair> >::type\
dispatch_uses_allocator(ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* pair, piecewise_construct_t\
, StdTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::std::tr1::_Nil)> p\
, StdTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::std::tr1::_Nil)> q)\
{\
(void)p; (void)q;\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_GET_IDX##N);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_GET_IDX##N);\
BOOST_TRY{\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_GET_IDXQ##M);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_GET_IDXQ##M);\
}\
BOOST_CATCH(...) {\
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(pair->first));\
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(pair->first));\
BOOST_RETHROW\
}\
BOOST_CATCH_END\
@@ -380,7 +380,7 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
template< typename ConstructAlloc, typename ArgAlloc, class Pair\
, template<BOOST_MOVE_REPEAT(_VARIADIC_MAX, class), class, class, class> class StdTuple \
BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
- typename container_detail::enable_if< container_detail::is_pair<Pair> >::type\
+ typename dtl::enable_if< dtl::is_pair<Pair> >::type\
dispatch_uses_allocator\
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* pair, piecewise_construct_t\
, StdTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(BOOST_MOVE_ADD(_VARIADIC_MAX, 3),N),::std::_Nil) > p\
@@ -388,13 +388,13 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
{\
(void)p; (void)q;\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_GET_IDX##N);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->first) BOOST_MOVE_I_IF(N) BOOST_MOVE_GET_IDX##N);\
BOOST_TRY{\
(dispatch_uses_allocator)\
- (construct_alloc, arg_alloc, container_detail::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_GET_IDXQ##M);\
+ (construct_alloc, arg_alloc, dtl::addressof(pair->second) BOOST_MOVE_I_IF(M) BOOST_MOVE_GET_IDXQ##M);\
}\
BOOST_CATCH(...) {\
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(pair->first));\
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(pair->first));\
BOOST_RETHROW\
}\
BOOST_CATCH_END\
@@ -411,16 +411,16 @@ BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_DISPATCH_USES_ALLOCATOR_PIECEWISE_CONSTRUCT_BO
template < typename ConstructAlloc
, typename ArgAlloc
, class Pair, class KeyType, class ... Args>
-typename container_detail::enable_if< container_detail::is_pair<Pair>, void >::type
+typename dtl::enable_if< dtl::is_pair<Pair>, void >::type
dispatch_uses_allocator
(ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k, BOOST_FWD_REF(Args) ...args)
{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->first), ::boost::forward<KeyType>(k));
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->first), ::boost::forward<KeyType>(k));
BOOST_TRY{
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->second), ::boost::forward<Args>(args)...);
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->second), ::boost::forward<Args>(args)...);
}
BOOST_CATCH(...) {
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(p->first));
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(p->first));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -430,18 +430,18 @@ typename container_detail::enable_if< container_detail::is_pair<Pair>, void >::t
#define BOOST_CONTAINER_DISPATCH_USES_ALLOCATOR_PAIR_TRY_EMPLACE_CODE(N) \
template <typename ConstructAlloc, typename ArgAlloc, class Pair, class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
- inline typename container_detail::enable_if\
- < container_detail::is_pair<Pair>, void >::type\
+ inline typename dtl::enable_if\
+ < dtl::is_pair<Pair>, void >::type\
dispatch_uses_allocator\
(ConstructAlloc &construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, Pair* p, try_emplace_t, \
BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->first), ::boost::forward<KeyType>(k));\
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->first), ::boost::forward<KeyType>(k));\
BOOST_TRY{\
- (dispatch_uses_allocator)(construct_alloc, arg_alloc, container_detail::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
+ (dispatch_uses_allocator)(construct_alloc, arg_alloc, dtl::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
}\
BOOST_CATCH(...) {\
- allocator_traits<ConstructAlloc>::destroy(construct_alloc, container_detail::addressof(p->first));\
+ allocator_traits<ConstructAlloc>::destroy(construct_alloc, dtl::addressof(p->first));\
BOOST_RETHROW\
}\
BOOST_CATCH_END\
@@ -452,7 +452,7 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_DISPATCH_USES_ALLOCATOR_PAIR_TRY_EMPLACE
#endif //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-} //namespace container_detail
+} //namespace dtl
}} // namespace boost { namespace container {
diff --git a/boost/container/detail/flat_tree.hpp b/boost/container/detail/flat_tree.hpp
index 319cad69a7..5f212e3fc8 100644
--- a/boost/container/detail/flat_tree.hpp
+++ b/boost/container/detail/flat_tree.hpp
@@ -47,6 +47,7 @@
#include <boost/move/iterator.hpp>
#include <boost/move/adl_move_swap.hpp>
#include <boost/move/algo/adaptive_sort.hpp>
+#include <boost/move/algo/detail/pdqsort.hpp>
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/move/detail/fwd_macros.hpp>
@@ -56,7 +57,7 @@
//merge_unique
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME merge_unique
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 3
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 3
@@ -64,7 +65,7 @@
//merge_equal
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME merge
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 3
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 3
@@ -72,7 +73,7 @@
//index_of
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME index_of
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 1
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 1
@@ -80,7 +81,7 @@
//nth
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME nth
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 1
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 1
@@ -88,7 +89,7 @@
//reserve
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME reserve
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 1
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 1
@@ -96,7 +97,7 @@
//capacity
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME capacity
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace container_detail {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace dtl {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
@@ -106,196 +107,297 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
+
+///////////////////////////////////////
+//
+// Helper functions to merge elements
+//
+///////////////////////////////////////
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(stored_allocator_type)
-template<class SequenceContainer, class Iterator, class Compare>
-BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_equal
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::true_)
+///////////////////////////////////////
+//
+// flat_tree_container_inplace_merge
+//
+///////////////////////////////////////
+template<class SequenceContainer, class Compare>
+void flat_tree_container_inplace_merge //is_contiguous_container == true
+ (SequenceContainer& dest, typename SequenceContainer::iterator it, Compare comp , dtl::true_)
{
- dest.merge(first, last, comp);
+ typedef typename SequenceContainer::value_type value_type;
+ value_type *const braw = boost::movelib::iterator_to_raw_pointer(dest.begin());
+ value_type *const iraw = boost::movelib::iterator_to_raw_pointer(it);
+ value_type *const eraw = boost::movelib::iterator_to_raw_pointer(dest.end());
+ boost::movelib::adaptive_merge(braw, iraw, eraw, comp, eraw, dest.capacity()- dest.size());
}
-template<class SequenceContainer, class Iterator, class Compare>
-BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_equal_non_merge_member
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::true_)
+template<class SequenceContainer, class Compare>
+void flat_tree_container_inplace_merge //is_contiguous_container == false
+ (SequenceContainer& dest, typename SequenceContainer::iterator it, Compare comp, dtl::false_)
{
- typedef typename SequenceContainer::iterator iterator;
- typedef typename SequenceContainer::value_type value_type;
+ boost::movelib::adaptive_merge(dest.begin(), it, dest.end(), comp);
+}
- iterator const it = dest.insert( dest.end(), first, last );
- value_type *const braw = boost::movelib::iterator_to_raw_pointer(dest.begin());
+///////////////////////////////////////
+//
+// flat_tree_container_inplace_sort_ending
+//
+///////////////////////////////////////
+template<class SequenceContainer, class Compare>
+void flat_tree_container_inplace_sort_ending //is_contiguous_container == true
+ (SequenceContainer& dest, typename SequenceContainer::iterator it, Compare comp, dtl::true_)
+{
+ typedef typename SequenceContainer::value_type value_type;
value_type *const iraw = boost::movelib::iterator_to_raw_pointer(it);
value_type *const eraw = boost::movelib::iterator_to_raw_pointer(dest.end());
- value_type *const sraw = boost::movelib::iterator_to_raw_pointer(dest.begin()+dest.size());
- boost::movelib::adaptive_sort(iraw, eraw, comp, sraw, dest.capacity());
- boost::movelib::adaptive_merge(braw, iraw, eraw, comp, sraw, dest.capacity()- dest.size());
+ boost::movelib::adaptive_sort(iraw, eraw, comp, eraw, dest.capacity()- dest.size());
}
-template<class SequenceContainer, class Iterator, class Compare>
-BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_equal_non_merge_member
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::false_)
+template<class SequenceContainer, class Compare>
+void flat_tree_container_inplace_sort_ending //is_contiguous_container == false
+ (SequenceContainer& dest, typename SequenceContainer::iterator it, Compare comp , dtl::false_)
{
- typedef typename SequenceContainer::iterator iterator;
-
- iterator const it = dest.insert( dest.end(), first, last );
boost::movelib::adaptive_sort(it, dest.end(), comp);
- boost::movelib::adaptive_merge(dest.begin(), it, dest.end(), comp);
}
+///////////////////////////////////////
+//
+// flat_tree_merge
+//
+///////////////////////////////////////
template<class SequenceContainer, class Iterator, class Compare>
BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_equal
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::false_)
+ (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, dtl::true_)
{
- (flat_tree_merge_equal_non_merge_member)( dest, first, last, comp
- , container_detail::bool_<is_contiguous_container<SequenceContainer>::value>());
+ dest.merge(first, last, comp);
}
template<class SequenceContainer, class Iterator, class Compare>
-BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_unique
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::true_)
+BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_equal //has_merge_unique == false
+ (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, dtl::false_)
+{
+ typedef typename SequenceContainer::iterator iterator;
+ iterator const it = dest.insert( dest.end(), first, last );
+ dtl::bool_<is_contiguous_container<SequenceContainer>::value> contiguous_tag;
+ (flat_tree_container_inplace_merge)(dest, it, comp, contiguous_tag);
+}
+
+///////////////////////////////////////
+//
+// flat_tree_merge_unique
+//
+///////////////////////////////////////
+template<class SequenceContainer, class Iterator, class Compare>
+BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_unique //has_merge_unique == true
+ (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, dtl::true_)
{
dest.merge_unique(first, last, comp);
}
template<class SequenceContainer, class Iterator, class Compare>
-BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_unique
- (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, container_detail::false_)
+BOOST_CONTAINER_FORCEINLINE void flat_tree_merge_unique //has_merge_unique == false
+ (SequenceContainer& dest, Iterator first, Iterator last, Compare comp, dtl::false_)
{
- (flat_tree_merge_equal)(dest, first, last, comp, container_detail::false_());
- dest.erase(boost::movelib::unique
- (dest.begin(), dest.end(), boost::movelib::negate<Compare>(comp)), dest.cend());
+ typedef typename SequenceContainer::iterator iterator;
+ typedef typename SequenceContainer::size_type size_type;
+
+ size_type const old_sz = dest.size();
+ iterator const first_new = dest.insert(dest.cend(), first, last );
+ iterator e = boost::movelib::inplace_set_difference(first_new, dest.end(), dest.begin(), first_new, comp);
+ dest.erase(e, dest.end());
+ dtl::bool_<is_contiguous_container<SequenceContainer>::value> contiguous_tag;
+ (flat_tree_container_inplace_merge)(dest, dest.begin()+old_sz, comp, contiguous_tag);
}
+///////////////////////////////////////
+//
+// flat_tree_index_of
+//
+///////////////////////////////////////
template<class SequenceContainer, class Iterator>
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::size_type
- flat_tree_index_of
- (SequenceContainer& cont, Iterator p, container_detail::true_)
+ flat_tree_index_of // has_index_of == true
+ (SequenceContainer& cont, Iterator p, dtl::true_)
{
return cont.index_of(p);
}
template<class SequenceContainer, class Iterator>
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::size_type
- flat_tree_index_of
- (SequenceContainer& cont, Iterator p, container_detail::false_)
+ flat_tree_index_of // has_index_of == false
+ (SequenceContainer& cont, Iterator p, dtl::false_)
{
typedef typename SequenceContainer::size_type size_type;
return static_cast<size_type>(p - cont.begin());
}
+///////////////////////////////////////
+//
+// flat_tree_nth
+//
+///////////////////////////////////////
template<class Iterator, class SequenceContainer>
BOOST_CONTAINER_FORCEINLINE Iterator
- flat_tree_nth
- (SequenceContainer& cont, typename SequenceContainer::size_type n, container_detail::true_)
+ flat_tree_nth // has_nth == true
+ (SequenceContainer& cont, typename SequenceContainer::size_type n, dtl::true_)
{
return cont.nth(n);
}
template<class Iterator, class SequenceContainer>
BOOST_CONTAINER_FORCEINLINE Iterator
- flat_tree_nth
- (SequenceContainer& cont, typename SequenceContainer::size_type n, container_detail::false_)
+ flat_tree_nth // has_nth == false
+ (SequenceContainer& cont, typename SequenceContainer::size_type n, dtl::false_)
{
return cont.begin()+ n;
}
+///////////////////////////////////////
+//
+// flat_tree_get_stored_allocator
+//
+///////////////////////////////////////
template<class SequenceContainer>
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::stored_allocator_type &
- flat_tree_get_stored_allocator
- (SequenceContainer& cont, container_detail::true_)
+ flat_tree_get_stored_allocator // has_get_stored_allocator == true
+ (SequenceContainer& cont, dtl::true_)
{
return cont.get_stored_allocator();
}
template<class SequenceContainer>
BOOST_CONTAINER_FORCEINLINE const typename SequenceContainer::stored_allocator_type &
- flat_tree_get_stored_allocator
- (const SequenceContainer& cont, container_detail::true_)
+ flat_tree_get_stored_allocator // has_get_stored_allocator == true
+ (const SequenceContainer& cont, dtl::true_)
{
return cont.get_stored_allocator();
}
template<class SequenceContainer>
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::allocator_type
- flat_tree_get_stored_allocator
- (SequenceContainer& cont, container_detail::false_)
+ flat_tree_get_stored_allocator // has_get_stored_allocator == false
+ (SequenceContainer& cont, dtl::false_)
{
return cont.get_allocator();
}
+///////////////////////////////////////
+//
+// flat_tree_adopt_sequence_equal
+//
+///////////////////////////////////////
template<class SequenceContainer, class Compare>
-void flat_tree_adopt_sequence_equal(SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, container_detail::true_)
+void flat_tree_sort_contiguous_to_adopt // is_contiguous_container == true
+ (SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp)
{
- tseq.clear();
- boost::movelib::adaptive_sort
- (boost::movelib::iterator_to_raw_pointer(seq.begin())
- , boost::movelib::iterator_to_raw_pointer(seq.end())
- , comp
- , boost::movelib::iterator_to_raw_pointer(tseq.begin() + tseq.size())
- , tseq.capacity() - tseq.size());
+ if(tseq.capacity() >= (seq.capacity() - seq.size())) {
+ tseq.clear();
+ boost::movelib::adaptive_sort
+ (boost::movelib::iterator_to_raw_pointer(seq.begin())
+ , boost::movelib::iterator_to_raw_pointer(seq.end())
+ , comp
+ , boost::movelib::iterator_to_raw_pointer(tseq.begin())
+ , tseq.capacity());
+ }
+ else{
+ boost::movelib::adaptive_sort
+ (boost::movelib::iterator_to_raw_pointer(seq.begin())
+ , boost::movelib::iterator_to_raw_pointer(seq.end())
+ , comp
+ , boost::movelib::iterator_to_raw_pointer(seq.end())
+ , seq.capacity() - seq.size());
+ }
+}
+
+template<class SequenceContainer, class Compare>
+void flat_tree_adopt_sequence_equal // is_contiguous_container == true
+ (SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, dtl::true_)
+{
+ flat_tree_sort_contiguous_to_adopt(tseq, boost::move(seq), comp);
tseq = boost::move(seq);
}
template<class SequenceContainer, class Compare>
-void flat_tree_adopt_sequence_equal(SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, container_detail::false_)
+void flat_tree_adopt_sequence_equal // is_contiguous_container == false
+ (SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, dtl::false_)
{
boost::movelib::adaptive_sort(seq.begin(), seq.end(), comp);
tseq = boost::move(seq);
}
+///////////////////////////////////////
+//
+// flat_tree_adopt_sequence_unique
+//
+///////////////////////////////////////
template<class SequenceContainer, class Compare>
-void flat_tree_adopt_sequence_unique(SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, container_detail::true_)
+void flat_tree_adopt_sequence_unique// is_contiguous_container == true
+ (SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, dtl::true_)
{
- boost::movelib::adaptive_sort
+ boost::movelib::pdqsort
( boost::movelib::iterator_to_raw_pointer(seq.begin())
, boost::movelib::iterator_to_raw_pointer(seq.end())
- , comp
- , boost::movelib::iterator_to_raw_pointer(tseq.begin() + tseq.size())
- , tseq.capacity() - tseq.size());
+ , comp);
seq.erase(boost::movelib::unique
- ( seq.begin(), seq.end(), boost::movelib::negate<Compare>(comp))
- , seq.cend());
+ (seq.begin(), seq.end(), boost::movelib::negate<Compare>(comp)), seq.cend());
tseq = boost::move(seq);
}
template<class SequenceContainer, class Compare>
-void flat_tree_adopt_sequence_unique(SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, container_detail::false_)
+void flat_tree_adopt_sequence_unique// is_contiguous_container == false
+ (SequenceContainer &tseq, BOOST_RV_REF(SequenceContainer) seq, Compare comp, dtl::false_)
{
- boost::movelib::adaptive_sort(seq.begin(), seq.end(), comp);
+ boost::movelib::pdqsort(seq.begin(), seq.end(), comp);
seq.erase(boost::movelib::unique
(seq.begin(), seq.end(), boost::movelib::negate<Compare>(comp)), seq.cend());
tseq = boost::move(seq);
}
+///////////////////////////////////////
+//
+// flat_tree_reserve
+//
+///////////////////////////////////////
template<class SequenceContainer>
-BOOST_CONTAINER_FORCEINLINE void
- flat_tree_reserve(SequenceContainer &tseq, typename SequenceContainer::size_type cap, container_detail::true_)
+BOOST_CONTAINER_FORCEINLINE void // has_reserve == true
+ flat_tree_reserve(SequenceContainer &tseq, typename SequenceContainer::size_type cap, dtl::true_)
{
tseq.reserve(cap);
}
template<class SequenceContainer>
-BOOST_CONTAINER_FORCEINLINE void
- flat_tree_reserve(SequenceContainer &, typename SequenceContainer::size_type, container_detail::false_)
+BOOST_CONTAINER_FORCEINLINE void // has_reserve == false
+ flat_tree_reserve(SequenceContainer &, typename SequenceContainer::size_type, dtl::false_)
{
}
-template<class SequenceContainer>
+///////////////////////////////////////
+//
+// flat_tree_capacity
+//
+///////////////////////////////////////
+template<class SequenceContainer> // has_capacity == true
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::size_type
- flat_tree_capacity(const SequenceContainer &tseq, container_detail::true_)
+ flat_tree_capacity(const SequenceContainer &tseq, dtl::true_)
{
return tseq.capacity();
}
-template<class SequenceContainer>
+template<class SequenceContainer> // has_capacity == false
BOOST_CONTAINER_FORCEINLINE typename SequenceContainer::size_type
- flat_tree_capacity(const SequenceContainer &tseq, container_detail::false_)
+ flat_tree_capacity(const SequenceContainer &tseq, dtl::false_)
{
return tseq.size();
}
+///////////////////////////////////////
+//
+// flat_tree_value_compare
+//
+///////////////////////////////////////
+
template<class Compare, class Value, class KeyOfValue>
class flat_tree_value_compare
: private Compare
@@ -324,21 +426,14 @@ class flat_tree_value_compare
Compare &get_comp()
{ return *this; }
};
-/*
-template<class Pointer>
-struct get_flat_tree_iterators
-{
- typedef typename boost::container::container_detail::
- vec_iterator<Pointer, false> iterator;
- typedef typename boost::container::container_detail::
- vec_iterator<Pointer, true > const_iterator;
- typedef boost::container::reverse_iterator<iterator> reverse_iterator;
- typedef boost::container::reverse_iterator<const_iterator> const_reverse_iterator;
-};
-*/
+///////////////////////////////////////
+//
+// select_container_type
+//
+///////////////////////////////////////
template < class Value, class AllocatorOrContainer
- , bool = boost::container::container_detail::is_container<AllocatorOrContainer>::value >
+ , bool = boost::container::dtl::is_container<AllocatorOrContainer>::value >
struct select_container_type
{
typedef AllocatorOrContainer type;
@@ -350,6 +445,12 @@ struct select_container_type<Value, AllocatorOrContainer, false>
typedef boost::container::vector<Value, AllocatorOrContainer> type;
};
+
+///////////////////////////////////////
+//
+// flat_tree
+//
+///////////////////////////////////////
template <class Value, class KeyOfValue,
class Compare, class AllocatorOrContainer>
class flat_tree
@@ -452,20 +553,20 @@ class flat_tree
//!Standard extension
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
- (boost::container::container_detail::, container_type
+ (boost::container::dtl::, container_type
,stored_allocator_type, allocator_type) stored_allocator_type;
static const bool has_stored_allocator_type =
- BOOST_INTRUSIVE_HAS_TYPE(boost::container::container_detail::, container_type, stored_allocator_type);
+ BOOST_INTRUSIVE_HAS_TYPE(boost::container::dtl::, container_type, stored_allocator_type);
private:
typedef allocator_traits<stored_allocator_type> stored_allocator_traits;
public:
- typedef typename container_detail::if_c
+ typedef typename dtl::if_c
<has_stored_allocator_type, const stored_allocator_type &, allocator_type>::type get_stored_allocator_const_return_t;
- typedef typename container_detail::if_c
+ typedef typename dtl::if_c
<has_stored_allocator_type, stored_allocator_type &, allocator_type>::type get_stored_allocator_noconst_return_t;
BOOST_CONTAINER_FORCEINLINE flat_tree()
@@ -489,7 +590,7 @@ class flat_tree
{ }
BOOST_CONTAINER_FORCEINLINE flat_tree(BOOST_RV_REF(flat_tree) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: m_data(boost::move(x.m_data))
{ }
@@ -599,7 +700,7 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE flat_tree& operator=(BOOST_RV_REF(flat_tree) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ m_data = boost::move(x.m_data); return *this; }
BOOST_CONTAINER_FORCEINLINE const value_compare &priv_value_comp() const
@@ -632,12 +733,12 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE get_stored_allocator_const_return_t get_stored_allocator() const
{
- return flat_tree_get_stored_allocator(this->m_data.m_seq, container_detail::bool_<has_stored_allocator_type>());
+ return flat_tree_get_stored_allocator(this->m_data.m_seq, dtl::bool_<has_stored_allocator_type>());
}
BOOST_CONTAINER_FORCEINLINE get_stored_allocator_noconst_return_t get_stored_allocator()
{
- return flat_tree_get_stored_allocator(this->m_data.m_seq, container_detail::bool_<has_stored_allocator_type>());
+ return flat_tree_get_stored_allocator(this->m_data.m_seq, dtl::bool_<has_stored_allocator_type>());
}
BOOST_CONTAINER_FORCEINLINE iterator begin()
@@ -687,7 +788,7 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE void swap(flat_tree& other)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value )
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value )
{ this->m_data.swap(other.m_data); }
public:
@@ -767,109 +868,51 @@ class flat_tree
template <class InIt>
void insert_unique(InIt first, InIt last)
{
- for ( ; first != last; ++first){
- this->insert_unique(*first);
- }
- }
+ dtl::bool_<is_contiguous_container<container_type>::value> contiguous_tag;
+ container_type &seq = this->m_data.m_seq;
+ value_compare &val_cmp = this->priv_value_comp();
- template <class InIt>
- void insert_equal(InIt first, InIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < container_detail::is_input_iterator<InIt>::value
- >::type * = 0
- #endif
- )
- { this->priv_insert_equal_loop(first, last); }
+ //Step 1: put new elements in the back
+ typename container_type::iterator const it = seq.insert(seq.cend(), first, last);
+
+ //Step 2: sort them
+ boost::movelib::pdqsort(it, seq.end(), val_cmp);
+
+ //Step 3: only left unique values from the back not already present in the original range
+ typename container_type::iterator const e = boost::movelib::inplace_set_unique_difference
+ (it, seq.end(), seq.begin(), it, val_cmp);
+ seq.erase(e, seq.cend());
+
+ //Step 4: merge both ranges
+ (flat_tree_container_inplace_merge)(seq, it, this->priv_value_comp(), contiguous_tag);
+ }
template <class InIt>
- void insert_equal(InIt first, InIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < !container_detail::is_input_iterator<InIt>::value
- >::type * = 0
- #endif
- )
+ void insert_equal(InIt first, InIt last)
{
- const size_type len = static_cast<size_type>(boost::container::iterator_distance(first, last));
- this->reserve(this->size()+len);
- this->priv_insert_equal_loop(first, last);
+ dtl::bool_<is_contiguous_container<container_type>::value> contiguous_tag;
+ container_type &seq = this->m_data.m_seq;
+ typename container_type::iterator const it = seq.insert(seq.cend(), first, last);
+ (flat_tree_container_inplace_sort_ending)(seq, it, this->priv_value_comp(), contiguous_tag);
+ (flat_tree_container_inplace_merge) (seq, it, this->priv_value_comp(), contiguous_tag);
}
//Ordered
template <class InIt>
- void insert_equal(ordered_range_t, InIt first, InIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < container_detail::is_input_iterator<InIt>::value
- >::type * = 0
- #endif
- )
- { this->priv_insert_equal_loop_ordered(first, last); }
-
- template <class FwdIt>
- void insert_equal(ordered_range_t, FwdIt first, FwdIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < !container_detail::is_input_iterator<FwdIt>::value &&
- container_detail::is_forward_iterator<FwdIt>::value
- >::type * = 0
- #endif
- )
- {
- const size_type len = static_cast<size_type>(boost::container::iterator_distance(first, last));
- this->reserve(this->size()+len);
- this->priv_insert_equal_loop_ordered(first, last);
- }
-
- template <class BidirIt>
- void insert_equal(ordered_range_t, BidirIt first, BidirIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
- < void
- , container_detail::is_input_iterator<BidirIt>
- , container_detail::is_forward_iterator<BidirIt>
- >::type * = 0
- #endif
- )
- {
- const bool value = boost::container::container_detail::
- has_member_function_callable_with_merge_unique<container_type, iterator, iterator, value_compare>::value;
- (flat_tree_merge_equal)(this->m_data.m_seq, first, last, this->priv_value_comp(), container_detail::bool_<value>());
+ void insert_equal(ordered_range_t, InIt first, InIt last)
+ {
+ const bool value = boost::container::dtl::
+ has_member_function_callable_with_merge_unique<container_type, InIt, InIt, value_compare>::value;
+ (flat_tree_merge_equal)(this->m_data.m_seq, first, last, this->priv_value_comp(), dtl::bool_<value>());
}
template <class InIt>
- void insert_unique(ordered_unique_range_t, InIt first, InIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_or
- < void
- , container_detail::is_input_iterator<InIt>
- , container_detail::is_forward_iterator<InIt>
- >::type * = 0
- #endif
- )
- {
- const_iterator pos(this->cend());
- for ( ; first != last; ++first){
- pos = this->insert_unique(pos, *first);
- ++pos;
- }
- }
-
- template <class BidirIt>
- void insert_unique(ordered_unique_range_t, BidirIt first, BidirIt last
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < !(container_detail::is_input_iterator<BidirIt>::value ||
- container_detail::is_forward_iterator<BidirIt>::value)
- >::type * = 0
- #endif
- )
+ void insert_unique(ordered_unique_range_t, InIt first, InIt last)
{
- const bool value = boost::container::container_detail::
- has_member_function_callable_with_merge_unique<container_type, iterator, iterator, value_compare>::value;
- (flat_tree_merge_unique)(this->m_data.m_seq, first, last, this->priv_value_comp(), container_detail::bool_<value>());
+ const bool value = boost::container::dtl::
+ has_member_function_callable_with_merge_unique<container_type, InIt, InIt, value_compare>::value;
+ (flat_tree_merge_unique)(this->m_data.m_seq, first, last, this->priv_value_comp(), dtl::bool_<value>());
}
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
@@ -878,7 +921,7 @@ class flat_tree
std::pair<iterator, bool> emplace_unique(BOOST_FWD_REF(Args)... args)
{
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
value_destructor<stored_allocator_type, value_type> d(a, val);
@@ -890,7 +933,7 @@ class flat_tree
{
//hint checked in insert_unique
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
value_destructor<stored_allocator_type, value_type> d(a, val);
@@ -901,7 +944,7 @@ class flat_tree
iterator emplace_equal(BOOST_FWD_REF(Args)... args)
{
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
value_destructor<stored_allocator_type, value_type> d(a, val);
@@ -913,7 +956,7 @@ class flat_tree
{
//hint checked in insert_equal
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
value_destructor<stored_allocator_type, value_type> d(a, val);
@@ -950,7 +993,7 @@ class flat_tree
std::pair<iterator, bool> emplace_unique(BOOST_MOVE_UREF##N)\
{\
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;\
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));\
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, &val BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_destructor<stored_allocator_type, value_type> d(a, val);\
@@ -961,7 +1004,7 @@ class flat_tree
iterator emplace_hint_unique(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;\
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));\
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, &val BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_destructor<stored_allocator_type, value_type> d(a, val);\
@@ -972,7 +1015,7 @@ class flat_tree
iterator emplace_equal(BOOST_MOVE_UREF##N)\
{\
typename aligned_storage<sizeof(value_type), alignment_of<value_type>::value>::type v;\
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));\
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, &val BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_destructor<stored_allocator_type, value_type> d(a, val);\
@@ -983,7 +1026,7 @@ class flat_tree
iterator emplace_hint_equal(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
typename aligned_storage <sizeof(value_type), alignment_of<value_type>::value>::type v;\
- value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));\
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(v.data));\
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
stored_allocator_traits::construct(a, &val BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
value_destructor<stored_allocator_type, value_type> d(a, val);\
@@ -1069,30 +1112,30 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE iterator nth(size_type n) BOOST_NOEXCEPT_OR_NOTHROW
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_nth<container_type, size_type>::value;
- return flat_tree_nth<iterator>(this->m_data.m_seq, n, container_detail::bool_<value>());
+ return flat_tree_nth<iterator>(this->m_data.m_seq, n, dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_nth<container_type, size_type>::value;
- return flat_tree_nth<const_iterator>(this->m_data.m_seq, n, container_detail::bool_<value>());
+ return flat_tree_nth<const_iterator>(this->m_data.m_seq, n, dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE size_type index_of(iterator p) BOOST_NOEXCEPT_OR_NOTHROW
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_index_of<container_type, iterator>::value;
- return flat_tree_index_of(this->m_data.m_seq, p, container_detail::bool_<value>());
+ return flat_tree_index_of(this->m_data.m_seq, p, dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE size_type index_of(const_iterator p) const BOOST_NOEXCEPT_OR_NOTHROW
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_index_of<container_type, const_iterator>::value;
- return flat_tree_index_of(this->m_data.m_seq, p, container_detail::bool_<value>());
+ return flat_tree_index_of(this->m_data.m_seq, p, dtl::bool_<value>());
}
// set operations:
@@ -1141,26 +1184,26 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE void merge_unique(flat_tree& source)
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_merge_unique<container_type, iterator, iterator, value_compare>::value;
(flat_tree_merge_unique)
( this->m_data.m_seq
, boost::make_move_iterator(source.m_data.m_seq.begin())
, boost::make_move_iterator(source.m_data.m_seq.end())
, this->priv_value_comp()
- , container_detail::bool_<value>());
+ , dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE void merge_equal(flat_tree& source)
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_merge<container_type, iterator, iterator, value_compare>::value;
(flat_tree_merge_equal)
( this->m_data.m_seq
, boost::make_move_iterator(source.m_data.m_seq.begin())
, boost::make_move_iterator(source.m_data.m_seq.end())
, this->priv_value_comp()
- , container_detail::bool_<value>());
+ , dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE iterator lower_bound(const key_type& k)
@@ -1189,16 +1232,16 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE size_type capacity() const
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_capacity<container_type>::value;
- return (flat_tree_capacity)(this->m_data.m_seq, container_detail::bool_<value>());
+ return (flat_tree_capacity)(this->m_data.m_seq, dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE void reserve(size_type cnt)
{
- const bool value = boost::container::container_detail::
+ const bool value = boost::container::dtl::
has_member_function_callable_with_reserve<container_type, size_type>::value;
- (flat_tree_reserve)(this->m_data.m_seq, cnt, container_detail::bool_<value>());
+ (flat_tree_reserve)(this->m_data.m_seq, cnt, dtl::bool_<value>());
}
BOOST_CONTAINER_FORCEINLINE container_type extract_sequence()
@@ -1214,13 +1257,13 @@ class flat_tree
BOOST_CONTAINER_FORCEINLINE void adopt_sequence_equal(BOOST_RV_REF(container_type) seq)
{
(flat_tree_adopt_sequence_equal)( m_data.m_seq, boost::move(seq), this->priv_value_comp()
- , container_detail::bool_<is_contiguous_container<container_type>::value>());
+ , dtl::bool_<is_contiguous_container<container_type>::value>());
}
BOOST_CONTAINER_FORCEINLINE void adopt_sequence_unique(BOOST_RV_REF(container_type) seq)
{
(flat_tree_adopt_sequence_unique)(m_data.m_seq, boost::move(seq), this->priv_value_comp()
- , container_detail::bool_<is_contiguous_container<container_type>::value>());
+ , dtl::bool_<is_contiguous_container<container_type>::value>());
}
void adopt_sequence_equal(ordered_range_t, BOOST_RV_REF(container_type) seq)
@@ -1270,14 +1313,10 @@ class flat_tree
//for the constructor
//Call end() every iteration as reallocation might have invalidated iterators
if(unique_insertion){
- for ( ; first != last; ++first){
- this->insert_unique(this->cend(), *first);
- }
+ this->insert_unique(first, last);
}
else{
- for ( ; first != last; ++first){
- this->insert_equal(this->cend(), *first);
- }
+ this->insert_equal (first, last);
}
}
@@ -1474,30 +1513,9 @@ class flat_tree
}
return std::pair<RanIt, RanIt>(lb, ub);
}
-
- template<class InIt>
- void priv_insert_equal_loop(InIt first, InIt last)
- {
- for ( ; first != last; ++first){
- this->insert_equal(*first);
- }
- }
-
- template<class InIt>
- void priv_insert_equal_loop_ordered(InIt first, InIt last)
- {
- const_iterator pos(this->cend());
- for ( ; first != last; ++first){
- //If ordered, then try hint version
- //to achieve constant-time complexity per insertion
- //in some cases
- pos = this->insert_equal(pos, *first);
- ++pos;
- }
- }
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
@@ -1505,9 +1523,9 @@ class flat_tree
//!specialization for optimizations
template <class T, class KeyOfValue,
class Compare, class AllocatorOrContainer>
-struct has_trivial_destructor_after_move<boost::container::container_detail::flat_tree<T, KeyOfValue, Compare, AllocatorOrContainer> >
+struct has_trivial_destructor_after_move<boost::container::dtl::flat_tree<T, KeyOfValue, Compare, AllocatorOrContainer> >
{
- typedef typename boost::container::container_detail::select_container_type<T, AllocatorOrContainer>::type container_type;
+ typedef typename boost::container::dtl::select_container_type<T, AllocatorOrContainer>::type container_type;
typedef typename container_type::allocator_type allocator_t;
typedef typename ::boost::container::allocator_traits<allocator_t>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_t>::value &&
diff --git a/boost/container/detail/is_container.hpp b/boost/container/detail/is_container.hpp
index 6052f045e0..feab702e9e 100644
--- a/boost/container/detail/is_container.hpp
+++ b/boost/container/detail/is_container.hpp
@@ -36,7 +36,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template <class Container>
struct is_container
@@ -48,7 +48,7 @@ struct is_container
has_member_function_callable_with_empty<const Container>::value;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/is_contiguous_container.hpp b/boost/container/detail/is_contiguous_container.hpp
index af98c7f18b..528aeee133 100644
--- a/boost/container/detail/is_contiguous_container.hpp
+++ b/boost/container/detail/is_contiguous_container.hpp
@@ -28,7 +28,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template <class Container>
struct is_contiguous_container
@@ -40,7 +40,7 @@ struct is_contiguous_container
has_member_function_callable_with_data<const Container>::value;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/is_sorted.hpp b/boost/container/detail/is_sorted.hpp
index b8c223bb7b..315bab54d7 100644
--- a/boost/container/detail/is_sorted.hpp
+++ b/boost/container/detail/is_sorted.hpp
@@ -20,7 +20,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template <class ForwardIterator, class Pred>
bool is_sorted (ForwardIterator first, ForwardIterator last, Pred pred)
@@ -50,7 +50,7 @@ bool is_sorted_and_unique (ForwardIterator first, ForwardIterator last, Pred pre
return true;
}
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/iterator.hpp b/boost/container/detail/iterator.hpp
index 8538acc161..2ceaf26001 100644
--- a/boost/container/detail/iterator.hpp
+++ b/boost/container/detail/iterator.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/iterator.hpp>
+#include <boost/move/utility_core.hpp>
namespace boost {
namespace container {
@@ -34,6 +35,35 @@ using ::boost::intrusive::iterator_enable_if_tag;
using ::boost::intrusive::iterator_disable_if_tag;
using ::boost::intrusive::iterator_arrow_result;
+template <class Container>
+class back_emplacer
+{
+ private:
+ Container& container;
+
+ public:
+ typedef std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ back_emplacer(Container& x)
+ : container(x)
+ {}
+
+ template<class U>
+ back_emplacer& operator=(BOOST_FWD_REF(U) value)
+ {
+ container.emplace_back(boost::forward<U>(value));
+ return *this;
+ }
+ back_emplacer& operator*() { return *this; }
+ back_emplacer& operator++() { return *this; }
+ back_emplacer& operator++(int){ return *this; }
+};
+
+
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/iterator_to_raw_pointer.hpp b/boost/container/detail/iterator_to_raw_pointer.hpp
index 8c7c880035..49f1d43bab 100644
--- a/boost/container/detail/iterator_to_raw_pointer.hpp
+++ b/boost/container/detail/iterator_to_raw_pointer.hpp
@@ -22,11 +22,11 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
using ::boost::movelib::iterator_to_raw_pointer;
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/iterators.hpp b/boost/container/detail/iterators.hpp
index 11ffaae65e..7ccdac911c 100644
--- a/boost/container/detail/iterators.hpp
+++ b/boost/container/detail/iterators.hpp
@@ -612,7 +612,7 @@ class emplace_iterator
template<class ...Args>
struct emplace_functor
{
- typedef typename container_detail::build_number_seq<sizeof...(Args)>::type index_tuple_t;
+ typedef typename dtl::build_number_seq<sizeof...(Args)>::type index_tuple_t;
emplace_functor(BOOST_FWD_REF(Args)... args)
: args_(args...)
@@ -628,21 +628,21 @@ struct emplace_functor
private:
template<class Allocator, class T, std::size_t ...IdxPack>
- BOOST_CONTAINER_FORCEINLINE void inplace_impl(Allocator &a, T* ptr, const container_detail::index_tuple<IdxPack...>&)
+ BOOST_CONTAINER_FORCEINLINE void inplace_impl(Allocator &a, T* ptr, const dtl::index_tuple<IdxPack...>&)
{
allocator_traits<Allocator>::construct
- (a, ptr, ::boost::forward<Args>(container_detail::get<IdxPack>(args_))...);
+ (a, ptr, ::boost::forward<Args>(dtl::get<IdxPack>(args_))...);
}
template<class DestIt, std::size_t ...IdxPack>
- BOOST_CONTAINER_FORCEINLINE void inplace_impl(DestIt dest, const container_detail::index_tuple<IdxPack...>&)
+ BOOST_CONTAINER_FORCEINLINE void inplace_impl(DestIt dest, const dtl::index_tuple<IdxPack...>&)
{
typedef typename boost::container::iterator_traits<DestIt>::value_type value_type;
- value_type && tmp= value_type(::boost::forward<Args>(container_detail::get<IdxPack>(args_))...);
+ value_type && tmp= value_type(::boost::forward<Args>(dtl::get<IdxPack>(args_))...);
*dest = ::boost::move(tmp);
}
- container_detail::tuple<Args&...> args_;
+ dtl::tuple<Args&...> args_;
};
template<class ...Args>
@@ -672,7 +672,7 @@ struct emplace_functor##N\
void operator()(DestIt dest)\
{\
typedef typename boost::container::iterator_traits<DestIt>::value_type value_type;\
- BOOST_MOVE_IF(N, value_type tmp(BOOST_MOVE_MFWD##N), container_detail::value_init<value_type> tmp) ;\
+ BOOST_MOVE_IF(N, value_type tmp(BOOST_MOVE_MFWD##N), dtl::value_init<value_type> tmp) ;\
*dest = ::boost::move(const_cast<value_type &>(BOOST_MOVE_IF(N, tmp, tmp.get())));\
}\
\
@@ -692,7 +692,7 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_MOVE_ITERATOR_EMPLACE_FUNCTOR_CODE)
#endif
-namespace container_detail {
+namespace dtl {
template<class T>
struct has_iterator_category
@@ -863,7 +863,7 @@ class iterator_from_iiterator
IIterator m_iit;
};
-} //namespace container_detail {
+} //namespace dtl {
using ::boost::intrusive::reverse_iterator;
diff --git a/boost/container/detail/math_functions.hpp b/boost/container/detail/math_functions.hpp
index e499f633ec..f1519315a3 100644
--- a/boost/container/detail/math_functions.hpp
+++ b/boost/container/detail/math_functions.hpp
@@ -32,7 +32,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
// Greatest common divisor and least common multiple
@@ -114,7 +114,7 @@ inline std::size_t floor_log2 (std::size_t x)
return log2;
}
-} // namespace container_detail
+} // namespace dtl
} // namespace container
} // namespace boost
diff --git a/boost/container/detail/min_max.hpp b/boost/container/detail/min_max.hpp
index 7486db7d05..35cf06617d 100644
--- a/boost/container/detail/min_max.hpp
+++ b/boost/container/detail/min_max.hpp
@@ -20,7 +20,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class T>
const T &max_value(const T &a, const T &b)
@@ -30,7 +30,7 @@ template<class T>
const T &min_value(const T &a, const T &b)
{ return a < b ? a : b; }
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/mpl.hpp b/boost/container/detail/mpl.hpp
index 82fcc7036d..4bb3cc7d22 100644
--- a/boost/container/detail/mpl.hpp
+++ b/boost/container/detail/mpl.hpp
@@ -30,7 +30,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
using boost::move_detail::integral_constant;
using boost::move_detail::true_type;
@@ -76,7 +76,7 @@ struct select1st
{ return const_cast<type&>(x.first); }
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/multiallocation_chain.hpp b/boost/container/detail/multiallocation_chain.hpp
index bce1b8651f..c10f809bb4 100644
--- a/boost/container/detail/multiallocation_chain.hpp
+++ b/boost/container/detail/multiallocation_chain.hpp
@@ -35,7 +35,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class VoidPointer>
class basic_multiallocation_chain
@@ -53,7 +53,7 @@ class basic_multiallocation_chain
typedef bi::slist< node
, bi::linear<true>
, bi::cache_last<true>
- , bi::size_type<typename boost::container::container_detail::make_unsigned<difference_type>::type>
+ , bi::size_type<typename boost::container::dtl::make_unsigned<difference_type>::type>
> slist_impl_t;
slist_impl_t slist_impl_;
@@ -182,7 +182,7 @@ class basic_multiallocation_chain
template<class T>
struct cast_functor
{
- typedef typename container_detail::add_reference<T>::type result_type;
+ typedef typename dtl::add_reference<T>::type result_type;
template<class U>
result_type operator()(U &ptr) const
{ return *static_cast<T*>(static_cast<void*>(&ptr)); }
@@ -211,7 +211,7 @@ class transform_multiallocation_chain
public:
typedef transform_iterator
< typename MultiallocationChain::iterator
- , container_detail::cast_functor <T> > iterator;
+ , dtl::cast_functor <T> > iterator;
typedef typename MultiallocationChain::size_type size_type;
transform_multiallocation_chain()
@@ -289,7 +289,7 @@ class transform_multiallocation_chain
}}}
-// namespace container_detail {
+// namespace dtl {
// namespace container {
// namespace boost {
diff --git a/boost/container/detail/mutex.hpp b/boost/container/detail/mutex.hpp
index 9743614c23..56e72a81d0 100644
--- a/boost/container/detail/mutex.hpp
+++ b/boost/container/detail/mutex.hpp
@@ -171,7 +171,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
#if BOOST_MUTEX_HELPER == BOOST_MUTEX_HELPER_NONE
class null_mutex
@@ -268,7 +268,7 @@ class scoped_lock
Mutex &m_;
};
-} // namespace container_detail
+} // namespace dtl
} // namespace container
} // namespace boost
diff --git a/boost/container/detail/next_capacity.hpp b/boost/container/detail/next_capacity.hpp
index 3bc98a3c91..7e6554ded0 100644
--- a/boost/container/detail/next_capacity.hpp
+++ b/boost/container/detail/next_capacity.hpp
@@ -23,52 +23,54 @@
// container/detail
#include <boost/container/detail/min_max.hpp>
+#include <boost/static_assert.hpp>
+
namespace boost {
namespace container {
-namespace container_detail {
-
-enum NextCapacityOption { NextCapacityDouble, NextCapacity60Percent };
-
-template<class SizeType, NextCapacityOption Option>
-struct next_capacity_calculator;
+namespace dtl {
-template<class SizeType>
-struct next_capacity_calculator<SizeType, NextCapacityDouble>
+template<unsigned Minimum, unsigned Numerator, unsigned Denominator>
+struct grow_factor_ratio
{
- static SizeType get(const SizeType max_size
- ,const SizeType capacity
- ,const SizeType n)
- {
- const SizeType remaining = max_size - capacity;
- if ( remaining < n )
- boost::container::throw_length_error("get_next_capacity, allocator's max_size reached");
- const SizeType additional = max_value(n, capacity);
- return ( remaining < additional ) ? max_size : ( capacity + additional );
- }
-};
+ BOOST_STATIC_ASSERT(Numerator > Denominator);
+ BOOST_STATIC_ASSERT(Numerator < 100);
+ BOOST_STATIC_ASSERT(Denominator < 100);
+ BOOST_STATIC_ASSERT(Denominator == 1 || (0 != Numerator % Denominator));
-template<class SizeType>
-struct next_capacity_calculator<SizeType, NextCapacity60Percent>
-{
- static SizeType get(const SizeType max_size
- ,const SizeType capacity
- ,const SizeType n)
+ template<class SizeType>
+ SizeType operator()(const SizeType cur_cap, const SizeType add_min_cap, const SizeType max_cap) const
{
- const SizeType remaining = max_size - capacity;
- if ( remaining < n )
- boost::container::throw_length_error("get_next_capacity, allocator's max_size reached");
- const SizeType m3 = max_size/3;
+ const SizeType overflow_limit = ((SizeType)-1) / Numerator;
- if (capacity < m3)
- return capacity + max_value(3*(capacity+1)/5, n);
+ SizeType new_cap = 0;
- if (capacity < m3*2)
- return capacity + max_value((capacity+1)/2, n);
- return max_size;
+ if(cur_cap <= overflow_limit){
+ new_cap = cur_cap * Numerator / Denominator;
+ }
+ else if(Denominator == 1 || (SizeType(new_cap = cur_cap) / Denominator) > overflow_limit){
+ new_cap = (SizeType)-1;
+ }
+ else{
+ new_cap *= Numerator;
+ }
+ return max_value(SizeType(Minimum), max_value(cur_cap+add_min_cap, min_value(max_cap, new_cap)));
}
};
-} //namespace container_detail {
+} //namespace dtl {
+
+struct growth_factor_50
+ : dtl::grow_factor_ratio<0, 3, 2>
+{};
+
+struct growth_factor_60
+ : dtl::grow_factor_ratio<0, 8, 5>
+{};
+
+struct growth_factor_100
+ : dtl::grow_factor_ratio<0, 2, 1>
+{};
+
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/node_alloc_holder.hpp b/boost/container/detail/node_alloc_holder.hpp
index b6e602e884..ad7b713d6e 100644
--- a/boost/container/detail/node_alloc_holder.hpp
+++ b/boost/container/detail/node_alloc_holder.hpp
@@ -50,7 +50,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(value_compare)
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(predicate_type)
@@ -61,14 +61,14 @@ struct node_alloc_holder
//If the intrusive container is an associative container, obtain the predicate, which will
//be of type node_compare<>. If not an associative container value_compare will be a "nat" type.
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
- ( boost::container::container_detail::
- , ICont, value_compare, container_detail::nat) intrusive_value_compare;
+ ( boost::container::dtl::
+ , ICont, value_compare, dtl::nat) intrusive_value_compare;
//In that case obtain the value predicate from the node predicate via predicate_type
//if intrusive_value_compare is node_compare<>, nat otherwise
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
- ( boost::container::container_detail::
+ ( boost::container::dtl::
, intrusive_value_compare
- , predicate_type, container_detail::nat) value_compare;
+ , predicate_type, dtl::nat) value_compare;
typedef allocator_traits<Allocator> allocator_traits_type;
typedef typename allocator_traits_type::value_type value_type;
@@ -77,14 +77,14 @@ struct node_alloc_holder
typedef typename allocator_traits_type::template
portable_rebind_alloc<Node>::type NodeAlloc;
typedef allocator_traits<NodeAlloc> node_allocator_traits_type;
- typedef container_detail::allocator_version_traits<NodeAlloc> node_allocator_version_traits_type;
+ typedef dtl::allocator_version_traits<NodeAlloc> node_allocator_version_traits_type;
typedef Allocator ValAlloc;
typedef typename node_allocator_traits_type::pointer NodePtr;
- typedef container_detail::scoped_deallocator<NodeAlloc> Deallocator;
+ typedef dtl::scoped_deallocator<NodeAlloc> Deallocator;
typedef typename node_allocator_traits_type::size_type size_type;
typedef typename node_allocator_traits_type::difference_type difference_type;
- typedef container_detail::integral_constant<unsigned,
- boost::container::container_detail::
+ typedef dtl::integral_constant<unsigned,
+ boost::container::dtl::
version<NodeAlloc>::value> alloc_version;
typedef typename ICont::iterator icont_iterator;
typedef typename ICont::const_iterator icont_citerator;
@@ -134,15 +134,15 @@ struct node_alloc_holder
void copy_assign_alloc(const node_alloc_holder &x)
{
- container_detail::bool_<allocator_traits_type::propagate_on_container_copy_assignment::value> flag;
- container_detail::assign_alloc( static_cast<NodeAlloc &>(this->members_)
+ dtl::bool_<allocator_traits_type::propagate_on_container_copy_assignment::value> flag;
+ dtl::assign_alloc( static_cast<NodeAlloc &>(this->members_)
, static_cast<const NodeAlloc &>(x.members_), flag);
}
void move_assign_alloc( node_alloc_holder &x)
{
- container_detail::bool_<allocator_traits_type::propagate_on_container_move_assignment::value> flag;
- container_detail::move_alloc( static_cast<NodeAlloc &>(this->members_)
+ dtl::bool_<allocator_traits_type::propagate_on_container_move_assignment::value> flag;
+ dtl::move_alloc( static_cast<NodeAlloc &>(this->members_)
, static_cast<NodeAlloc &>(x.members_), flag);
}
@@ -167,7 +167,7 @@ struct node_alloc_holder
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
( this->node_alloc()
- , container_detail::addressof(p->m_data), boost::forward<Args>(args)...);
+ , dtl::addressof(p->m_data), boost::forward<Args>(args)...);
node_deallocator.release();
//This does not throw
typedef typename Node::hook_type hook_type;
@@ -185,7 +185,7 @@ struct node_alloc_holder
Deallocator node_deallocator(p, this->node_alloc());\
allocator_traits<NodeAlloc>::construct\
( this->node_alloc()\
- , container_detail::addressof(p->m_data)\
+ , dtl::addressof(p->m_data)\
BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
node_deallocator.release();\
typedef typename Node::hook_type hook_type;\
@@ -203,7 +203,7 @@ struct node_alloc_holder
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
- ::boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->m_data), it);
+ ::boost::container::construct_in_place(this->node_alloc(), dtl::addressof(p->m_data), it);
node_deallocator.release();
//This does not throw
typedef typename Node::hook_type hook_type;
@@ -218,12 +218,12 @@ struct node_alloc_holder
NodeAlloc &na = this->node_alloc();
Deallocator node_deallocator(p, this->node_alloc());
node_allocator_traits_type::construct
- (na, container_detail::addressof(p->m_data.first), boost::forward<KeyConvertible>(key));
+ (na, dtl::addressof(p->m_data.first), boost::forward<KeyConvertible>(key));
BOOST_TRY{
- node_allocator_traits_type::construct(na, container_detail::addressof(p->m_data.second));
+ node_allocator_traits_type::construct(na, dtl::addressof(p->m_data.second));
}
BOOST_CATCH(...){
- node_allocator_traits_type::destroy(na, container_detail::addressof(p->m_data.first));
+ node_allocator_traits_type::destroy(na, dtl::addressof(p->m_data.first));
BOOST_RETHROW;
}
BOOST_CATCH_END
@@ -243,8 +243,8 @@ struct node_alloc_holder
void swap(node_alloc_holder &x)
{
this->icont().swap(x.icont());
- container_detail::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
- container_detail::swap_alloc(this->node_alloc(), x.node_alloc(), flag);
+ dtl::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
+ dtl::swap_alloc(this->node_alloc(), x.node_alloc(), flag);
}
template<class FwdIterator, class Inserter>
@@ -264,13 +264,13 @@ struct node_alloc_holder
Node *p = 0;
BOOST_TRY{
Deallocator node_deallocator(NodePtr(), nalloc);
- container_detail::scoped_destructor<NodeAlloc> sdestructor(nalloc, 0);
+ dtl::scoped_destructor<NodeAlloc> sdestructor(nalloc, 0);
while(n--){
p = boost::movelib::iterator_to_raw_pointer(itbeg);
node_deallocator.set(p);
++itbeg;
//This can throw
- boost::container::construct_in_place(nalloc, container_detail::addressof(p->m_data), beg);
+ boost::container::construct_in_place(nalloc, dtl::addressof(p->m_data), beg);
sdestructor.set(p);
++beg;
//This does not throw
@@ -410,7 +410,7 @@ struct node_alloc_holder
{ return this->members_.m_icont; }
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/node_pool.hpp b/boost/container/detail/node_pool.hpp
index 00e35dfa8d..e43956b643 100644
--- a/boost/container/detail/node_pool.hpp
+++ b/boost/container/detail/node_pool.hpp
@@ -32,7 +32,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
//!Pooled memory allocator using single segregated storage. Includes
//!a reference count but the class does not delete itself, this is
@@ -41,10 +41,10 @@ namespace container_detail {
template< std::size_t NodeSize, std::size_t NodesPerBlock >
class private_node_pool
//Inherit from the implementation to avoid template bloat
- : public boost::container::container_detail::
+ : public boost::container::dtl::
private_node_pool_impl<fake_segment_manager>
{
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
private_node_pool_impl<fake_segment_manager> base_t;
//Non-copyable
private_node_pool(const private_node_pool &);
@@ -148,7 +148,7 @@ class shared_node_pool
default_mutex mutex_;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/node_pool_impl.hpp b/boost/container/detail/node_pool_impl.hpp
index 024bf306c5..97f555bc75 100644
--- a/boost/container/detail/node_pool_impl.hpp
+++ b/boost/container/detail/node_pool_impl.hpp
@@ -38,7 +38,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class SegmentManagerBase>
class private_node_pool_impl
@@ -366,7 +366,7 @@ class private_node_pool_impl
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/pair.hpp b/boost/container/detail/pair.hpp
index 4755e569b2..6b00db1483 100644
--- a/boost/container/detail/pair.hpp
+++ b/boost/container/detail/pair.hpp
@@ -74,7 +74,7 @@ struct is_boost_tuple< boost::tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8,
template<class Tuple>
struct disable_if_boost_tuple
- : boost::container::container_detail::disable_if< is_boost_tuple<Tuple> >
+ : boost::container::dtl::disable_if< is_boost_tuple<Tuple> >
{};
template<class T>
@@ -133,7 +133,7 @@ static piecewise_construct_t piecewise_construct = BOOST_CONTAINER_DOC1ST(unspec
///@cond
-namespace container_detail {
+namespace dtl {
struct piecewise_construct_use
{
@@ -283,7 +283,7 @@ struct pair
pair( piecewise_construct_t\
, BoostTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> p\
, BoostTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::boost::tuples::null_type)> q\
- , typename container_detail::enable_if_c\
+ , typename dtl::enable_if_c\
< pair_impl::is_boost_tuple< BoostTuple<BOOST_MOVE_TARG##N BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> >::value &&\
!(pair_impl::is_tuple_null<BOOST_MOVE_LAST_TARG##N>::value || pair_impl::is_tuple_null<BOOST_MOVE_LAST_TARGQ##M>::value) \
>::type* = 0\
@@ -381,10 +381,10 @@ struct pair
}
template <class D, class S>
- typename ::boost::container::container_detail::disable_if_or
+ typename ::boost::container::dtl::disable_if_or
< pair &
- , ::boost::container::container_detail::is_same<T1, D>
- , ::boost::container::container_detail::is_same<T2, S>
+ , ::boost::container::dtl::is_same<T1, D>
+ , ::boost::container::dtl::is_same<T2, S>
>::type
operator=(const pair<D, S>&p)
{
@@ -394,10 +394,10 @@ struct pair
}
template <class D, class S>
- typename ::boost::container::container_detail::disable_if_or
+ typename ::boost::container::dtl::disable_if_or
< pair &
- , ::boost::container::container_detail::is_same<T1, D>
- , ::boost::container::container_detail::is_same<T2, S>
+ , ::boost::container::dtl::is_same<T1, D>
+ , ::boost::container::dtl::is_same<T2, S>
>::type
operator=(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
{
@@ -478,13 +478,13 @@ template <class T1, class T2>
inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
{ x.swap(y); }
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class T1, class T2>
-struct has_move_emulation_enabled< ::boost::container::container_detail::pair<T1, T2> >
+struct has_move_emulation_enabled< ::boost::container::dtl::pair<T1, T2> >
{
static const bool value = true;
};
@@ -497,7 +497,7 @@ template<class T>
struct is_class_or_union;
template <class T1, class T2>
-struct is_class_or_union< ::boost::container::container_detail::pair<T1, T2> >
+struct is_class_or_union< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
@@ -516,7 +516,7 @@ template<class T>
struct is_union;
template <class T1, class T2>
-struct is_union< ::boost::container::container_detail::pair<T1, T2> >
+struct is_union< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
@@ -535,7 +535,7 @@ template<class T>
struct is_class;
template <class T1, class T2>
-struct is_class< ::boost::container::container_detail::pair<T1, T2> >
+struct is_class< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
diff --git a/boost/container/detail/pool_common.hpp b/boost/container/detail/pool_common.hpp
index 61d0612ed1..f42c1dd4d2 100644
--- a/boost/container/detail/pool_common.hpp
+++ b/boost/container/detail/pool_common.hpp
@@ -26,7 +26,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class VoidPointer>
struct node_slist
@@ -48,7 +48,7 @@ struct is_stateless_segment_manager
static const bool value = false;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/pool_common_alloc.hpp b/boost/container/detail/pool_common_alloc.hpp
index 3a3c80a78f..bfb82f5561 100644
--- a/boost/container/detail/pool_common_alloc.hpp
+++ b/boost/container/detail/pool_common_alloc.hpp
@@ -30,10 +30,10 @@
namespace boost{
namespace container{
-namespace container_detail{
+namespace dtl{
struct node_slist_helper
- : public boost::container::container_detail::node_slist<void*>
+ : public boost::container::dtl::node_slist<void*>
{};
struct fake_segment_manager
@@ -41,7 +41,7 @@ struct fake_segment_manager
typedef void * void_pointer;
static const std::size_t PayloadPerAllocation = BOOST_CONTAINER_ALLOCATION_PAYLOAD;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
basic_multiallocation_chain<void*> multiallocation_chain;
static void deallocate(void_pointer p)
{ dlmalloc_free(p); }
@@ -77,23 +77,23 @@ struct fake_segment_manager
} //namespace boost{
} //namespace container{
-} //namespace container_detail{
+} //namespace dtl{
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class T>
struct is_stateless_segment_manager;
template<>
struct is_stateless_segment_manager
- <boost::container::container_detail::fake_segment_manager>
+ <boost::container::dtl::fake_segment_manager>
{
static const bool value = true;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/singleton.hpp b/boost/container/detail/singleton.hpp
index 6fd6a54f30..7601c3ca8c 100644
--- a/boost/container/detail/singleton.hpp
+++ b/boost/container/detail/singleton.hpp
@@ -69,7 +69,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
// T must be: no-throw default constructible and no-throw destructible
template <typename T>
@@ -112,7 +112,7 @@ template <typename T>
typename singleton_default<T>::object_creator
singleton_default<T>::create_object;
-} // namespace container_detail
+} // namespace dtl
} // namespace container
} // namespace boost
diff --git a/boost/container/detail/transform_iterator.hpp b/boost/container/detail/transform_iterator.hpp
index ba64c7de79..ce81813ebb 100644
--- a/boost/container/detail/transform_iterator.hpp
+++ b/boost/container/detail/transform_iterator.hpp
@@ -63,7 +63,7 @@ class transform_iterator
: public UnaryFunction
, public boost::container::iterator
< typename Iterator::iterator_category
- , typename container_detail::remove_reference<typename UnaryFunction::result_type>::type
+ , typename dtl::remove_reference<typename UnaryFunction::result_type>::type
, typename Iterator::difference_type
, operator_arrow_proxy<typename UnaryFunction::result_type>
, typename UnaryFunction::result_type>
diff --git a/boost/container/detail/tree.hpp b/boost/container/detail/tree.hpp
index 99baf3a257..8d41158490 100644
--- a/boost/container/detail/tree.hpp
+++ b/boost/container/detail/tree.hpp
@@ -61,7 +61,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
using boost::intrusive::tree_value_compare;
@@ -71,38 +71,38 @@ struct intrusive_tree_hook;
template<class VoidPointer, bool OptimizeSize>
struct intrusive_tree_hook<VoidPointer, boost::container::red_black_tree, OptimizeSize>
{
- typedef typename container_detail::bi::make_set_base_hook
- < container_detail::bi::void_pointer<VoidPointer>
- , container_detail::bi::link_mode<container_detail::bi::normal_link>
- , container_detail::bi::optimize_size<OptimizeSize>
+ typedef typename dtl::bi::make_set_base_hook
+ < dtl::bi::void_pointer<VoidPointer>
+ , dtl::bi::link_mode<dtl::bi::normal_link>
+ , dtl::bi::optimize_size<OptimizeSize>
>::type type;
};
template<class VoidPointer, bool OptimizeSize>
struct intrusive_tree_hook<VoidPointer, boost::container::avl_tree, OptimizeSize>
{
- typedef typename container_detail::bi::make_avl_set_base_hook
- < container_detail::bi::void_pointer<VoidPointer>
- , container_detail::bi::link_mode<container_detail::bi::normal_link>
- , container_detail::bi::optimize_size<OptimizeSize>
+ typedef typename dtl::bi::make_avl_set_base_hook
+ < dtl::bi::void_pointer<VoidPointer>
+ , dtl::bi::link_mode<dtl::bi::normal_link>
+ , dtl::bi::optimize_size<OptimizeSize>
>::type type;
};
template<class VoidPointer, bool OptimizeSize>
struct intrusive_tree_hook<VoidPointer, boost::container::scapegoat_tree, OptimizeSize>
{
- typedef typename container_detail::bi::make_bs_set_base_hook
- < container_detail::bi::void_pointer<VoidPointer>
- , container_detail::bi::link_mode<container_detail::bi::normal_link>
+ typedef typename dtl::bi::make_bs_set_base_hook
+ < dtl::bi::void_pointer<VoidPointer>
+ , dtl::bi::link_mode<dtl::bi::normal_link>
>::type type;
};
template<class VoidPointer, bool OptimizeSize>
struct intrusive_tree_hook<VoidPointer, boost::container::splay_tree, OptimizeSize>
{
- typedef typename container_detail::bi::make_bs_set_base_hook
- < container_detail::bi::void_pointer<VoidPointer>
- , container_detail::bi::link_mode<container_detail::bi::normal_link>
+ typedef typename dtl::bi::make_bs_set_base_hook
+ < dtl::bi::void_pointer<VoidPointer>
+ , dtl::bi::link_mode<dtl::bi::normal_link>
>::type type;
};
@@ -222,9 +222,9 @@ class push_back_functor
{ this->icont_.push_back(n); }
};
-}//namespace container_detail {
+}//namespace dtl {
-namespace container_detail {
+namespace dtl {
template< class NodeType, class NodeCompareType
, class SizeType, class HookType
@@ -235,12 +235,12 @@ template<class NodeType, class NodeCompareType, class SizeType, class HookType>
struct intrusive_tree_dispatch
<NodeType, NodeCompareType, SizeType, HookType, boost::container::red_black_tree>
{
- typedef typename container_detail::bi::make_rbtree
+ typedef typename dtl::bi::make_rbtree
<NodeType
- ,container_detail::bi::compare<NodeCompareType>
- ,container_detail::bi::base_hook<HookType>
- ,container_detail::bi::constant_time_size<true>
- ,container_detail::bi::size_type<SizeType>
+ ,dtl::bi::compare<NodeCompareType>
+ ,dtl::bi::base_hook<HookType>
+ ,dtl::bi::constant_time_size<true>
+ ,dtl::bi::size_type<SizeType>
>::type type;
};
@@ -248,12 +248,12 @@ template<class NodeType, class NodeCompareType, class SizeType, class HookType>
struct intrusive_tree_dispatch
<NodeType, NodeCompareType, SizeType, HookType, boost::container::avl_tree>
{
- typedef typename container_detail::bi::make_avltree
+ typedef typename dtl::bi::make_avltree
<NodeType
- ,container_detail::bi::compare<NodeCompareType>
- ,container_detail::bi::base_hook<HookType>
- ,container_detail::bi::constant_time_size<true>
- ,container_detail::bi::size_type<SizeType>
+ ,dtl::bi::compare<NodeCompareType>
+ ,dtl::bi::base_hook<HookType>
+ ,dtl::bi::constant_time_size<true>
+ ,dtl::bi::size_type<SizeType>
>::type type;
};
@@ -261,12 +261,12 @@ template<class NodeType, class NodeCompareType, class SizeType, class HookType>
struct intrusive_tree_dispatch
<NodeType, NodeCompareType, SizeType, HookType, boost::container::scapegoat_tree>
{
- typedef typename container_detail::bi::make_sgtree
+ typedef typename dtl::bi::make_sgtree
<NodeType
- ,container_detail::bi::compare<NodeCompareType>
- ,container_detail::bi::base_hook<HookType>
- ,container_detail::bi::floating_point<true>
- ,container_detail::bi::size_type<SizeType>
+ ,dtl::bi::compare<NodeCompareType>
+ ,dtl::bi::base_hook<HookType>
+ ,dtl::bi::floating_point<true>
+ ,dtl::bi::size_type<SizeType>
>::type type;
};
@@ -274,12 +274,12 @@ template<class NodeType, class NodeCompareType, class SizeType, class HookType>
struct intrusive_tree_dispatch
<NodeType, NodeCompareType, SizeType, HookType, boost::container::splay_tree>
{
- typedef typename container_detail::bi::make_splaytree
+ typedef typename dtl::bi::make_splaytree
<NodeType
- ,container_detail::bi::compare<NodeCompareType>
- ,container_detail::bi::base_hook<HookType>
- ,container_detail::bi::constant_time_size<true>
- ,container_detail::bi::size_type<SizeType>
+ ,dtl::bi::compare<NodeCompareType>
+ ,dtl::bi::base_hook<HookType>
+ ,dtl::bi::constant_time_size<true>
+ ,dtl::bi::size_type<SizeType>
>::type type;
};
@@ -293,7 +293,7 @@ struct intrusive_tree_type
allocator_traits<Allocator>::void_pointer void_pointer;
typedef typename boost::container::
allocator_traits<Allocator>::size_type size_type;
- typedef typename container_detail::tree_node
+ typedef typename dtl::tree_node
< value_type, void_pointer
, tree_type_value, OptimizeSize> node_t;
typedef value_to_node_compare
@@ -340,9 +340,9 @@ struct intrusive_tree_proxy<tree_type_value, true>
{ c.rebalance(); }
};
-} //namespace container_detail {
+} //namespace dtl {
-namespace container_detail {
+namespace dtl {
//This functor will be used with Intrusive clone functions to obtain
//already allocated nodes from a intrusive container instead of
@@ -429,25 +429,40 @@ struct key_node_compare
{ return this->key_comp()(key_of_value()(nonkey1.get_data()), key_of_value()(nonkey2.get_data())); }
};
-template <class T, class KeyOfValue,
- class Compare, class Allocator,
- class Options = tree_assoc_defaults>
+template<class Options>
+struct get_tree_opt
+{
+ typedef Options type;
+};
+
+template<>
+struct get_tree_opt<void>
+{
+ typedef tree_assoc_defaults type;
+};
+
+template <class T, class KeyOfValue, class Compare, class Allocator, class Options>
class tree
- : public container_detail::node_alloc_holder
+ : public dtl::node_alloc_holder
< Allocator
- , typename container_detail::intrusive_tree_type
+ , typename dtl::intrusive_tree_type
< Allocator, tree_value_compare
<typename allocator_traits<Allocator>::pointer, Compare, KeyOfValue>
- , Options::tree_type, Options::optimize_size>::type
+ , get_tree_opt<Options>::type::tree_type
+ , get_tree_opt<Options>::type::optimize_size
+ >::type
>
{
typedef tree_value_compare
< typename allocator_traits<Allocator>::pointer
, Compare, KeyOfValue> ValComp;
- typedef typename container_detail::intrusive_tree_type
- < Allocator, ValComp, Options::tree_type
- , Options::optimize_size>::type Icont;
- typedef container_detail::node_alloc_holder
+ typedef typename get_tree_opt<Options>::type options_type;
+ typedef typename dtl::intrusive_tree_type
+ < Allocator, ValComp
+ , options_type::tree_type
+ , options_type::optimize_size
+ >::type Icont;
+ typedef dtl::node_alloc_holder
<Allocator, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
typedef tree < T, KeyOfValue
@@ -459,9 +474,9 @@ class tree
typedef typename AllocHolder::Node Node;
typedef typename Icont::iterator iiterator;
typedef typename Icont::const_iterator iconst_iterator;
- typedef container_detail::allocator_destroyer<NodeAlloc> Destroyer;
+ typedef dtl::allocator_destroyer<NodeAlloc> Destroyer;
typedef typename AllocHolder::alloc_version alloc_version;
- typedef intrusive_tree_proxy<Options::tree_type> intrusive_tree_proxy_t;
+ typedef intrusive_tree_proxy<options_type::tree_type> intrusive_tree_proxy_t;
BOOST_COPYABLE_AND_MOVABLE(tree)
@@ -484,9 +499,9 @@ class tree
allocator_traits<Allocator>::size_type size_type;
typedef typename boost::container::
allocator_traits<Allocator>::difference_type difference_type;
- typedef container_detail::iterator_from_iiterator
+ typedef dtl::iterator_from_iiterator
<iiterator, false> iterator;
- typedef container_detail::iterator_from_iiterator
+ typedef dtl::iterator_from_iiterator
<iiterator, true > const_iterator;
typedef boost::container::reverse_iterator
<iterator> reverse_iterator;
@@ -590,10 +605,10 @@ class tree
template <class InputIterator>
void tree_construct_non_unique(InputIterator first, InputIterator last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_or
+ , typename dtl::enable_if_or
< void
- , container_detail::is_same<alloc_version, version_1>
- , container_detail::is_input_iterator<InputIterator>
+ , dtl::is_same<alloc_version, version_1>
+ , dtl::is_input_iterator<InputIterator>
>::type * = 0
#endif
)
@@ -610,10 +625,10 @@ class tree
template <class InputIterator>
void tree_construct_non_unique(InputIterator first, InputIterator last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_same<alloc_version, version_1>
- , container_detail::is_input_iterator<InputIterator>
+ , dtl::is_same<alloc_version, version_1>
+ , dtl::is_input_iterator<InputIterator>
>::type * = 0
#endif
)
@@ -627,10 +642,10 @@ class tree
template <class InputIterator>
void tree_construct( ordered_range_t, InputIterator first, InputIterator last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_same<alloc_version, version_1>
- , container_detail::is_input_iterator<InputIterator>
+ , dtl::is_same<alloc_version, version_1>
+ , dtl::is_input_iterator<InputIterator>
>::type * = 0
#endif
)
@@ -638,17 +653,17 @@ class tree
//Optimized allocation and construction
this->allocate_many_and_construct
( first, boost::container::iterator_distance(first, last)
- , container_detail::push_back_functor<Node, Icont>(this->icont()));
+ , dtl::push_back_functor<Node, Icont>(this->icont()));
//AllocHolder clears in case of exception
}
template <class InputIterator>
void tree_construct( ordered_range_t, InputIterator first, InputIterator last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_or
+ , typename dtl::enable_if_or
< void
- , container_detail::is_same<alloc_version, version_1>
- , container_detail::is_input_iterator<InputIterator>
+ , dtl::is_same<alloc_version, version_1>
+ , dtl::is_input_iterator<InputIterator>
>::type * = 0
#endif
)
@@ -668,7 +683,7 @@ class tree
}
BOOST_CONTAINER_FORCEINLINE tree(BOOST_RV_REF(tree) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: AllocHolder(BOOST_MOVE_BASE(AllocHolder, x), x.value_comp())
{}
@@ -701,7 +716,7 @@ class tree
if (&x != this){
NodeAlloc &this_alloc = this->get_stored_allocator();
const NodeAlloc &x_alloc = x.get_stored_allocator();
- container_detail::bool_<allocator_traits<NodeAlloc>::
+ dtl::bool_<allocator_traits<NodeAlloc>::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
@@ -730,7 +745,7 @@ class tree
tree& operator=(BOOST_RV_REF(tree) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{
BOOST_ASSERT(this != &x);
NodeAlloc &this_alloc = this->node_alloc();
@@ -856,7 +871,7 @@ class tree
BOOST_CONTAINER_FORCEINLINE void swap(ThisType& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value )
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value )
{ AllocHolder::swap(x); }
public:
@@ -1315,7 +1330,7 @@ class tree
{ x.swap(y); }
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
template <class T>
@@ -1326,7 +1341,7 @@ struct has_trivial_destructor_after_move;
template <class T, class KeyOfValue, class Compare, class Allocator, class Options>
struct has_trivial_destructor_after_move
<
- ::boost::container::container_detail::tree
+ ::boost::container::dtl::tree
<T, KeyOfValue, Compare, Allocator, Options>
>
{
diff --git a/boost/container/detail/type_traits.hpp b/boost/container/detail/type_traits.hpp
index e1453a6594..686cc409b7 100644
--- a/boost/container/detail/type_traits.hpp
+++ b/boost/container/detail/type_traits.hpp
@@ -28,7 +28,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
using ::boost::move_detail::enable_if;
using ::boost::move_detail::enable_if_and;
@@ -63,7 +63,7 @@ using ::boost::move_detail::aligned_storage;
using ::boost::move_detail::nat;
using ::boost::move_detail::max_align_t;
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/value_functors.hpp b/boost/container/detail/value_functors.hpp
new file mode 100644
index 0000000000..a2c494c5e7
--- /dev/null
+++ b/boost/container/detail/value_functors.hpp
@@ -0,0 +1,36 @@
+#ifndef BOOST_CONTAINER_DETAIL_VALUE_FUNCTORS_HPP
+#define BOOST_CONTAINER_DETAIL_VALUE_FUNCTORS_HPP
+///////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2017-2017. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+//Functors for member algorithm defaults
+template<class ValueType>
+struct value_less
+{
+ bool operator()(const ValueType &a, const ValueType &b) const
+ { return a < b; }
+};
+
+template<class ValueType>
+struct value_equal
+{
+ bool operator()(const ValueType &a, const ValueType &b) const
+ { return a == b; }
+};
+
+#endif //BOOST_CONTAINER_DETAIL_VALUE_FUNCTORS_HPP
diff --git a/boost/container/detail/value_init.hpp b/boost/container/detail/value_init.hpp
index faba70ee14..35b0aa11d3 100644
--- a/boost/container/detail/value_init.hpp
+++ b/boost/container/detail/value_init.hpp
@@ -26,7 +26,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<class T>
struct value_init
@@ -42,7 +42,7 @@ struct value_init
T m_t;
};
-} //namespace container_detail {
+} //namespace dtl {
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/variadic_templates_tools.hpp b/boost/container/detail/variadic_templates_tools.hpp
index e9fa9cd15a..1e6f3df742 100644
--- a/boost/container/detail/variadic_templates_tools.hpp
+++ b/boost/container/detail/variadic_templates_tools.hpp
@@ -28,7 +28,7 @@
namespace boost {
namespace container {
-namespace container_detail {
+namespace dtl {
template<typename... Values>
class tuple;
@@ -156,7 +156,7 @@ struct build_number_seq
template<> struct build_number_seq<0> : index_tuple<>{};
template<> struct build_number_seq<1> : index_tuple<0>{};
-}}} //namespace boost { namespace container { namespace container_detail {
+}}} //namespace boost { namespace container { namespace dtl {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/version_type.hpp b/boost/container/detail/version_type.hpp
index a20b3eedaa..c2531ccc31 100644
--- a/boost/container/detail/version_type.hpp
+++ b/boost/container/detail/version_type.hpp
@@ -32,11 +32,11 @@
namespace boost{
namespace container {
-namespace container_detail {
+namespace dtl {
template <class T, unsigned V>
struct version_type
- : public container_detail::integral_constant<unsigned, V>
+ : public dtl::integral_constant<unsigned, V>
{
typedef T type;
@@ -46,7 +46,7 @@ struct version_type
namespace impl{
template <class T,
- bool = container_detail::is_convertible<version_type<T, 0>, typename T::version>::value>
+ bool = dtl::is_convertible<version_type<T, 0>, typename T::version>::value>
struct extract_version
{
static const unsigned value = 1;
@@ -86,7 +86,7 @@ struct version<T, true>
template <class T>
struct version
- : public container_detail::integral_constant<unsigned, impl::version<T>::value>
+ : public dtl::integral_constant<unsigned, impl::version<T>::value>
{};
template<class T, unsigned N>
@@ -96,11 +96,11 @@ struct is_version
is_same< typename version<T>::type, integral_constant<unsigned, N> >::value;
};
-} //namespace container_detail {
+} //namespace dtl {
-typedef container_detail::integral_constant<unsigned, 0> version_0;
-typedef container_detail::integral_constant<unsigned, 1> version_1;
-typedef container_detail::integral_constant<unsigned, 2> version_2;
+typedef dtl::integral_constant<unsigned, 0> version_0;
+typedef dtl::integral_constant<unsigned, 1> version_1;
+typedef dtl::integral_constant<unsigned, 2> version_2;
} //namespace container {
} //namespace boost{
diff --git a/boost/container/flat_map.hpp b/boost/container/flat_map.hpp
index d87f7bd7d4..ffd0d058ab 100644
--- a/boost/container/flat_map.hpp
+++ b/boost/container/flat_map.hpp
@@ -57,7 +57,7 @@ namespace container {
template <class Key, class T, class Compare, class AllocatorOrContainer>
class flat_multimap;
-namespace container_detail{
+namespace dtl{
template<class D, class S>
BOOST_CONTAINER_FORCEINLINE static D &force(S &s)
@@ -71,7 +71,7 @@ BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s)
return ret_val;
}
-} //namespace container_detail{
+} //namespace dtl{
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -115,18 +115,18 @@ class flat_map
private:
BOOST_COPYABLE_AND_MOVABLE(flat_map)
//This is the tree that we should store if pair was movable
- typedef container_detail::flat_tree<
+ typedef dtl::flat_tree<
std::pair<Key, T>,
- container_detail::select1st<Key>,
+ dtl::select1st<Key>,
Compare,
AllocatorOrContainer> tree_t;
//This is the real tree stored here. It's based on a movable pair
- typedef container_detail::flat_tree<
- container_detail::pair<Key, T>,
- container_detail::select1st<Key>,
+ typedef dtl::flat_tree<
+ dtl::pair<Key, T>,
+ dtl::select1st<Key>,
Compare,
- typename container_detail::container_or_allocator_rebind<AllocatorOrContainer, container_detail::pair<Key, T> >::type
+ typename dtl::container_or_allocator_rebind<AllocatorOrContainer, dtl::pair<Key, T> >::type
> impl_tree_t;
impl_tree_t m_flat_tree; // flat tree representing flat_map
@@ -138,9 +138,9 @@ class flat_map
typedef std::initializer_list<impl_value_type> impl_initializer_list;
#endif
- typedef container_detail::flat_tree_value_compare
+ typedef dtl::flat_tree_value_compare
< Compare
- , container_detail::select1st<Key>
+ , dtl::select1st<Key>
, std::pair<Key, T> > value_compare_t;
typedef typename tree_t::iterator iterator_t;
typedef typename tree_t::const_iterator const_iterator_t;
@@ -195,7 +195,7 @@ class flat_map
typedef BOOST_CONTAINER_IMPDEF(impl_value_type) movable_value_type;
//AllocatorOrContainer::value_type must be std::pair<Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<Key, T>, typename allocator_type::value_type>::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<std::pair<Key, T>, typename allocator_type::value_type>::value));
//////////////////////////////////////////////
//
@@ -206,8 +206,8 @@ class flat_map
//! <b>Effects</b>: Default constructs an empty flat_map.
//!
//! <b>Complexity</b>: Constant.
- BOOST_CONTAINER_FORCEINLINE flat_map() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_CONTAINER_FORCEINLINE flat_map() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: m_flat_tree()
{}
@@ -215,7 +215,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE explicit flat_map(const allocator_type& a)
- : m_flat_tree(container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified
@@ -231,7 +231,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE flat_map(const Compare& comp, const allocator_type& a)
- : m_flat_tree(comp, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map and
@@ -251,7 +251,7 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE flat_map(InputIterator first, InputIterator last, const allocator_type& a)
- : m_flat_tree(true, first, last, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(true, first, last, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
@@ -271,7 +271,7 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE flat_map(InputIterator first, InputIterator last, const Compare& comp, const allocator_type& a)
- : m_flat_tree(true, first, last, comp, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(true, first, last, comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map
@@ -316,7 +316,7 @@ class flat_map
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_map(ordered_unique_range_t, InputIterator first, InputIterator last, const Compare& comp, const allocator_type& a)
- : m_flat_tree(ordered_range, first, last, comp, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(ordered_range, first, last, comp, dtl::force<const impl_allocator_type>(a))
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -327,8 +327,8 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
BOOST_CONTAINER_FORCEINLINE flat_map(std::initializer_list<value_type> il)
: m_flat_tree( true
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end())
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end())
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified
@@ -338,9 +338,9 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
BOOST_CONTAINER_FORCEINLINE flat_map(std::initializer_list<value_type> il, const allocator_type& a)
: m_flat_tree( true
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
- , container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
+ , dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
@@ -350,8 +350,8 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
BOOST_CONTAINER_FORCEINLINE flat_map(std::initializer_list<value_type> il, const Compare& comp)
: m_flat_tree(true
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
, comp)
{}
@@ -362,10 +362,10 @@ class flat_map
//! the predicate and otherwise N logN, where N is last - first.
BOOST_CONTAINER_FORCEINLINE flat_map(std::initializer_list<value_type> il, const Compare& comp, const allocator_type& a)
: m_flat_tree(true
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
, comp
- , container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using and
@@ -380,8 +380,8 @@ class flat_map
//! <b>Note</b>: Non-standard extension.
BOOST_CONTAINER_FORCEINLINE flat_map(ordered_unique_range_t, std::initializer_list<value_type> il)
: m_flat_tree(ordered_unique_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end())
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end())
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
@@ -396,8 +396,8 @@ class flat_map
//! <b>Note</b>: Non-standard extension.
BOOST_CONTAINER_FORCEINLINE flat_map(ordered_unique_range_t, std::initializer_list<value_type> il, const Compare& comp)
: m_flat_tree(ordered_unique_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
, comp)
{}
@@ -413,10 +413,10 @@ class flat_map
//! <b>Note</b>: Non-standard extension.
BOOST_CONTAINER_FORCEINLINE flat_map(ordered_unique_range_t, std::initializer_list<value_type> il, const Compare& comp, const allocator_type& a)
: m_flat_tree( ordered_unique_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
, comp
- , container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<const impl_allocator_type>(a))
{}
#endif
@@ -434,7 +434,7 @@ class flat_map
//!
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE flat_map(BOOST_RV_REF(flat_map) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: m_flat_tree(boost::move(x.m_flat_tree))
{}
@@ -442,7 +442,7 @@ class flat_map
//!
//! <b>Complexity</b>: Linear in x.size().
BOOST_CONTAINER_FORCEINLINE flat_map(const flat_map& x, const allocator_type &a)
- : m_flat_tree(x.m_flat_tree, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(x.m_flat_tree, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Move constructs a flat_map using the specified allocator.
@@ -450,7 +450,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant if x.get_allocator() == a, linear otherwise.
BOOST_CONTAINER_FORCEINLINE flat_map(BOOST_RV_REF(flat_map) x, const allocator_type &a)
- : m_flat_tree(boost::move(x.m_flat_tree), container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(boost::move(x.m_flat_tree), dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Makes *this a copy of x.
@@ -471,7 +471,7 @@ class flat_map
BOOST_CONTAINER_FORCEINLINE flat_map& operator=(BOOST_RV_REF(flat_map) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ m_flat_tree = boost::move(x.m_flat_tree); return *this; }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -489,7 +489,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE allocator_type get_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
+ { return dtl::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
//!
@@ -501,7 +501,7 @@ class flat_map
BOOST_CONTAINER_FORCEINLINE get_stored_allocator_noconst_return_t get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW
{
impl_get_stored_allocator_noconst_return_t r = m_flat_tree.get_stored_allocator();
- return container_detail::force<stored_allocator_type>(r);
+ return dtl::force<stored_allocator_type>(r);
}
//! <b>Effects</b>: Returns a reference to the internal allocator.
@@ -514,7 +514,7 @@ class flat_map
BOOST_CONTAINER_FORCEINLINE get_stored_allocator_const_return_t get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
{
impl_get_stored_allocator_const_return_t r = m_flat_tree.get_stored_allocator();
- return container_detail::force<const stored_allocator_type>(r);
+ return dtl::force<const stored_allocator_type>(r);
}
//////////////////////////////////////////////
@@ -529,7 +529,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE iterator begin() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.begin()); }
+ { return dtl::force_copy<iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
//!
@@ -537,7 +537,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.begin()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
//!
@@ -545,7 +545,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE iterator end() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.end()); }
+ { return dtl::force_copy<iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
//!
@@ -553,7 +553,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.end()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -562,7 +562,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
+ { return dtl::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -571,7 +571,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed container.
@@ -580,7 +580,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rend()); }
+ { return dtl::force_copy<reverse_iterator>(m_flat_tree.rend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed container.
@@ -589,7 +589,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
//!
@@ -597,7 +597,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.cbegin()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.cbegin()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
//!
@@ -605,7 +605,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.cend()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.cend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -614,7 +614,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed container.
@@ -623,7 +623,7 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
//////////////////////////////////////////////
//
@@ -731,7 +731,7 @@ class flat_map
template <class M>
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> insert_or_assign(const key_type& k, BOOST_FWD_REF(M) obj)
{
- return container_detail::force_copy< std::pair<iterator, bool> >
+ return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign
( impl_const_iterator(), k, ::boost::forward<M>(obj))
);
@@ -752,7 +752,7 @@ class flat_map
template <class M>
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> insert_or_assign(BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
{
- return container_detail::force_copy< std::pair<iterator, bool> >
+ return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign
( impl_const_iterator(), ::boost::move(k), ::boost::forward<M>(obj))
);
@@ -775,9 +775,9 @@ class flat_map
template <class M>
BOOST_CONTAINER_FORCEINLINE iterator insert_or_assign(const_iterator hint, const key_type& k, BOOST_FWD_REF(M) obj)
{
- return container_detail::force_copy< std::pair<iterator, bool> >
+ return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign
- ( container_detail::force_copy<impl_const_iterator>(hint)
+ ( dtl::force_copy<impl_const_iterator>(hint)
, k, ::boost::forward<M>(obj))
);
}
@@ -799,28 +799,28 @@ class flat_map
template <class M>
BOOST_CONTAINER_FORCEINLINE iterator insert_or_assign(const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
{
- return container_detail::force_copy< std::pair<iterator, bool> >
+ return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign
- ( container_detail::force_copy<impl_const_iterator>(hint)
+ ( dtl::force_copy<impl_const_iterator>(hint)
, ::boost::move(k), ::boost::forward<M>(obj))
);
}
//! @copydoc ::boost::container::flat_set::nth(size_type)
BOOST_CONTAINER_FORCEINLINE iterator nth(size_type n) BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.nth(n)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.nth(n)); }
//! @copydoc ::boost::container::flat_set::nth(size_type) const
BOOST_CONTAINER_FORCEINLINE const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.nth(n)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.nth(n)); }
//! @copydoc ::boost::container::flat_set::index_of(iterator)
BOOST_CONTAINER_FORCEINLINE size_type index_of(iterator p) BOOST_NOEXCEPT_OR_NOTHROW
- { return m_flat_tree.index_of(container_detail::force_copy<impl_iterator>(p)); }
+ { return m_flat_tree.index_of(dtl::force_copy<impl_iterator>(p)); }
//! @copydoc ::boost::container::flat_set::index_of(const_iterator) const
BOOST_CONTAINER_FORCEINLINE size_type index_of(const_iterator p) const BOOST_NOEXCEPT_OR_NOTHROW
- { return m_flat_tree.index_of(container_detail::force_copy<impl_const_iterator>(p)); }
+ { return m_flat_tree.index_of(dtl::force_copy<impl_const_iterator>(p)); }
//! Returns: A reference to the element whose key is equivalent to x.
//!
@@ -872,7 +872,7 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class... Args>
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,bool> emplace(BOOST_FWD_REF(Args)... args)
- { return container_detail::force_copy< std::pair<iterator, bool> >(m_flat_tree.emplace_unique(boost::forward<Args>(args)...)); }
+ { return dtl::force_copy< std::pair<iterator, bool> >(m_flat_tree.emplace_unique(boost::forward<Args>(args)...)); }
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... in the container if and only if there is
@@ -889,8 +889,8 @@ class flat_map
template <class... Args>
BOOST_CONTAINER_FORCEINLINE iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.emplace_hint_unique( container_detail::force_copy<impl_const_iterator>(hint)
+ return dtl::force_copy<iterator>
+ (m_flat_tree.emplace_hint_unique( dtl::force_copy<impl_const_iterator>(hint)
, boost::forward<Args>(args)...));
}
@@ -908,7 +908,7 @@ class flat_map
template <class... Args>
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> try_emplace(const key_type& k, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy< std::pair<iterator, bool> >(
+ return dtl::force_copy< std::pair<iterator, bool> >(
m_flat_tree.try_emplace(impl_const_iterator(), k, boost::forward<Args>(args)...));
}
@@ -926,8 +926,8 @@ class flat_map
template <class... Args>
BOOST_CONTAINER_FORCEINLINE iterator try_emplace(const_iterator hint, const key_type &k, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy<iterator>(m_flat_tree.try_emplace
- (container_detail::force_copy<impl_const_iterator>(hint), k, boost::forward<Args>(args)...).first);
+ return dtl::force_copy<iterator>(m_flat_tree.try_emplace
+ (dtl::force_copy<impl_const_iterator>(hint), k, boost::forward<Args>(args)...).first);
}
//! <b>Requires</b>: value_type shall be EmplaceConstructible into map from piecewise_construct,
@@ -944,7 +944,7 @@ class flat_map
template <class... Args>
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> try_emplace(BOOST_RV_REF(key_type) k, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy< std::pair<iterator, bool> >
+ return dtl::force_copy< std::pair<iterator, bool> >
(m_flat_tree.try_emplace(impl_const_iterator(), boost::move(k), boost::forward<Args>(args)...));
}
@@ -962,8 +962,8 @@ class flat_map
template <class... Args>
BOOST_CONTAINER_FORCEINLINE iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.try_emplace(container_detail::force_copy
+ return dtl::force_copy<iterator>
+ (m_flat_tree.try_emplace(dtl::force_copy
<impl_const_iterator>(hint), boost::move(k), boost::forward<Args>(args)...).first);
}
@@ -973,39 +973,39 @@ class flat_map
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,bool> emplace(BOOST_MOVE_UREF##N)\
{\
- return container_detail::force_copy< std::pair<iterator, bool> >\
+ return dtl::force_copy< std::pair<iterator, bool> >\
(m_flat_tree.emplace_unique(BOOST_MOVE_FWD##N));\
}\
\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE iterator emplace_hint(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
- return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_unique\
- (container_detail::force_copy<impl_const_iterator>(hint) BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
+ return dtl::force_copy<iterator>(m_flat_tree.emplace_hint_unique\
+ (dtl::force_copy<impl_const_iterator>(hint) BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
}\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> try_emplace(const key_type& k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
- return container_detail::force_copy< std::pair<iterator, bool> >\
+ return dtl::force_copy< std::pair<iterator, bool> >\
(m_flat_tree.try_emplace(impl_const_iterator(), k BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
}\
\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE iterator try_emplace(const_iterator hint, const key_type &k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
- { return container_detail::force_copy<iterator>(m_flat_tree.try_emplace\
- (container_detail::force_copy<impl_const_iterator>(hint), k BOOST_MOVE_I##N BOOST_MOVE_FWD##N).first); }\
+ { return dtl::force_copy<iterator>(m_flat_tree.try_emplace\
+ (dtl::force_copy<impl_const_iterator>(hint), k BOOST_MOVE_I##N BOOST_MOVE_FWD##N).first); }\
\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> try_emplace(BOOST_RV_REF(key_type) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
- return container_detail::force_copy< std::pair<iterator, bool> >\
+ return dtl::force_copy< std::pair<iterator, bool> >\
(m_flat_tree.try_emplace(impl_const_iterator(), boost::move(k) BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
}\
\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
- { return container_detail::force_copy<iterator>(m_flat_tree.try_emplace\
- (container_detail::force_copy<impl_const_iterator>(hint), boost::move(k) BOOST_MOVE_I##N BOOST_MOVE_FWD##N).first); }\
+ { return dtl::force_copy<iterator>(m_flat_tree.try_emplace\
+ (dtl::force_copy<impl_const_iterator>(hint), boost::move(k) BOOST_MOVE_I##N BOOST_MOVE_FWD##N).first); }\
//
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_FLAT_MAP_EMPLACE_CODE)
#undef BOOST_CONTAINER_FLAT_MAP_EMPLACE_CODE
@@ -1024,8 +1024,8 @@ class flat_map
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,bool> insert(const value_type& x)
- { return container_detail::force_copy<std::pair<iterator,bool> >(
- m_flat_tree.insert_unique(container_detail::force<const impl_value_type>(x))); }
+ { return dtl::force_copy<std::pair<iterator,bool> >(
+ m_flat_tree.insert_unique(dtl::force<const impl_value_type>(x))); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
@@ -1039,8 +1039,8 @@ class flat_map
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
- { return container_detail::force_copy<std::pair<iterator,bool> >(
- m_flat_tree.insert_unique(boost::move(container_detail::force<impl_value_type>(x)))); }
+ { return dtl::force_copy<std::pair<iterator,bool> >(
+ m_flat_tree.insert_unique(boost::move(dtl::force<impl_value_type>(x)))); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
@@ -1055,7 +1055,7 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,bool> insert(BOOST_RV_REF(movable_value_type) x)
{
- return container_detail::force_copy<std::pair<iterator,bool> >
+ return dtl::force_copy<std::pair<iterator,bool> >
(m_flat_tree.insert_unique(boost::move(x)));
}
@@ -1072,9 +1072,9 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, const value_type& x)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.insert_unique( container_detail::force_copy<impl_const_iterator>(p)
- , container_detail::force<const impl_value_type>(x)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.insert_unique( dtl::force_copy<impl_const_iterator>(p)
+ , dtl::force<const impl_value_type>(x)));
}
//! <b>Effects</b>: Inserts an element move constructed from x in the container.
@@ -1088,9 +1088,9 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.insert_unique( container_detail::force_copy<impl_const_iterator>(p)
- , boost::move(container_detail::force<impl_value_type>(x))));
+ return dtl::force_copy<iterator>
+ (m_flat_tree.insert_unique( dtl::force_copy<impl_const_iterator>(p)
+ , boost::move(dtl::force<impl_value_type>(x))));
}
//! <b>Effects</b>: Inserts an element move constructed from x in the container.
@@ -1104,8 +1104,8 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, BOOST_RV_REF(movable_value_type) x)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.insert_unique(container_detail::force_copy<impl_const_iterator>(p), boost::move(x)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.insert_unique(dtl::force_copy<impl_const_iterator>(p), boost::move(x)));
}
//! <b>Requires</b>: first, last are not iterators into *this.
@@ -1113,8 +1113,7 @@ class flat_map
//! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(size()+N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -1130,8 +1129,7 @@ class flat_map
//! if there is no element with key equivalent to the key of that element. This
//! function is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
//!
@@ -1144,14 +1142,13 @@ class flat_map
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()) if and only
//! if there is no element with key equivalent to the key of that element.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from il.first() to il.end())
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(std::initializer_list<value_type> il)
{
- m_flat_tree.insert_unique( container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end());
+ m_flat_tree.insert_unique( dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end());
}
//! <b>Requires</b>: [il.begin(), il.end()) must be ordered according to the predicate and must be
@@ -1161,8 +1158,7 @@ class flat_map
//! if there is no element with key equivalent to the key of that element. This
//! function is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
//!
@@ -1170,8 +1166,8 @@ class flat_map
BOOST_CONTAINER_FORCEINLINE void insert(ordered_unique_range_t, std::initializer_list<value_type> il)
{
m_flat_tree.insert_unique(ordered_unique_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end());
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end());
}
#endif
@@ -1220,8 +1216,8 @@ class flat_map
//! not less than the erased element.
BOOST_CONTAINER_FORCEINLINE iterator erase(const_iterator p)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.erase(container_detail::force_copy<impl_const_iterator>(p)));
+ return dtl::force_copy<iterator>
+ (m_flat_tree.erase(dtl::force_copy<impl_const_iterator>(p)));
}
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -1243,9 +1239,9 @@ class flat_map
//! linear to the elements with bigger keys.
BOOST_CONTAINER_FORCEINLINE iterator erase(const_iterator first, const_iterator last)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.erase( container_detail::force_copy<impl_const_iterator>(first)
- , container_detail::force_copy<impl_const_iterator>(last)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.erase( dtl::force_copy<impl_const_iterator>(first)
+ , dtl::force_copy<impl_const_iterator>(last)));
}
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -1255,7 +1251,7 @@ class flat_map
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE void swap(flat_map& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value )
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value )
{ m_flat_tree.swap(x.m_flat_tree); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
@@ -1277,14 +1273,14 @@ class flat_map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE key_compare key_comp() const
- { return container_detail::force_copy<key_compare>(m_flat_tree.key_comp()); }
+ { return dtl::force_copy<key_compare>(m_flat_tree.key_comp()); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE value_compare value_comp() const
- { return value_compare(container_detail::force_copy<key_compare>(m_flat_tree.key_comp())); }
+ { return value_compare(dtl::force_copy<key_compare>(m_flat_tree.key_comp())); }
//////////////////////////////////////////////
//
@@ -1297,14 +1293,14 @@ class flat_map
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE iterator find(const key_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.find(x)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE const_iterator find(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.find(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
@@ -1317,40 +1313,40 @@ class flat_map
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE iterator lower_bound(const key_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE const_iterator lower_bound(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE iterator upper_bound(const key_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE const_iterator upper_bound(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,iterator> equal_range(const key_type& x)
- { return container_detail::force_copy<std::pair<iterator,iterator> >(m_flat_tree.lower_bound_range(x)); }
+ { return dtl::force_copy<std::pair<iterator,iterator> >(m_flat_tree.lower_bound_range(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE std::pair<const_iterator, const_iterator> equal_range(const key_type& x) const
- { return container_detail::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.lower_bound_range(x)); }
+ { return dtl::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.lower_bound_range(x)); }
//! <b>Effects</b>: Extracts the internal sequence container.
//!
@@ -1361,7 +1357,7 @@ class flat_map
//! <b>Throws</b>: If secuence_type's move constructor throws
BOOST_CONTAINER_FORCEINLINE sequence_type extract_sequence()
{
- return boost::move(container_detail::force<sequence_type>(m_flat_tree.get_sequence_ref()));
+ return boost::move(dtl::force<sequence_type>(m_flat_tree.get_sequence_ref()));
}
//! <b>Effects</b>: Discards the internally hold sequence container and adopts the
@@ -1371,7 +1367,7 @@ class flat_map
//!
//! <b>Throws</b>: If the comparison or the move constructor throws
BOOST_CONTAINER_FORCEINLINE void adopt_sequence(BOOST_RV_REF(sequence_type) seq)
- { this->m_flat_tree.adopt_sequence_unique(boost::move(container_detail::force<impl_sequence_type>(seq))); }
+ { this->m_flat_tree.adopt_sequence_unique(boost::move(dtl::force<impl_sequence_type>(seq))); }
//! <b>Requires</b>: seq shall be ordered according to this->compare()
//! and shall contain unique elements.
@@ -1383,7 +1379,7 @@ class flat_map
//!
//! <b>Throws</b>: If the move assignment throws
BOOST_CONTAINER_FORCEINLINE void adopt_sequence(ordered_unique_range_t, BOOST_RV_REF(sequence_type) seq)
- { this->m_flat_tree.adopt_sequence_unique(ordered_unique_range_t(), boost::move(container_detail::force<impl_sequence_type>(seq))); }
+ { this->m_flat_tree.adopt_sequence_unique(ordered_unique_range_t(), boost::move(dtl::force<impl_sequence_type>(seq))); }
//! <b>Effects</b>: Returns true if x and y are equal
//!
@@ -1434,7 +1430,7 @@ class flat_map
iterator i = lower_bound(k);
// i->first is greater than or equivalent to k.
if (i == end() || key_comp()(k, (*i).first)){
- container_detail::value_init<mapped_type> m;
+ dtl::value_init<mapped_type> m;
i = insert(i, impl_value_type(k, ::boost::move(m.m_t)));
}
return (*i).second;
@@ -1445,7 +1441,7 @@ class flat_map
iterator i = lower_bound(k);
// i->first is greater than or equivalent to k.
if (i == end() || key_comp()(k, (*i).first)){
- container_detail::value_init<mapped_type> m;
+ dtl::value_init<mapped_type> m;
i = insert(i, impl_value_type(boost::move(k), ::boost::move(m.m_t)));
}
return (*i).second;
@@ -1510,17 +1506,17 @@ class flat_multimap
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(flat_multimap)
- typedef container_detail::flat_tree<
+ typedef dtl::flat_tree<
std::pair<Key, T>,
- container_detail::select1st<Key>,
+ dtl::select1st<Key>,
Compare,
AllocatorOrContainer> tree_t;
//This is the real tree stored here. It's based on a movable pair
- typedef container_detail::flat_tree<
- container_detail::pair<Key, T>,
- container_detail::select1st<Key>,
+ typedef dtl::flat_tree<
+ dtl::pair<Key, T>,
+ dtl::select1st<Key>,
Compare,
- typename container_detail::container_or_allocator_rebind<AllocatorOrContainer, container_detail::pair<Key, T> >::type
+ typename dtl::container_or_allocator_rebind<AllocatorOrContainer, dtl::pair<Key, T> >::type
> impl_tree_t;
impl_tree_t m_flat_tree; // flat tree representing flat_map
@@ -1532,9 +1528,9 @@ class flat_multimap
typedef std::initializer_list<impl_value_type> impl_initializer_list;
#endif
- typedef container_detail::flat_tree_value_compare
+ typedef dtl::flat_tree_value_compare
< Compare
- , container_detail::select1st<Key>
+ , dtl::select1st<Key>
, std::pair<Key, T> > value_compare_t;
typedef typename tree_t::iterator iterator_t;
typedef typename tree_t::const_iterator const_iterator_t;
@@ -1584,7 +1580,7 @@ class flat_multimap
typedef BOOST_CONTAINER_IMPDEF(impl_value_type) movable_value_type;
//AllocatorOrContainer::value_type must be std::pair<Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<Key, T>, typename AllocatorOrContainer::value_type>::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<std::pair<Key, T>, typename AllocatorOrContainer::value_type>::value));
//////////////////////////////////////////////
//
@@ -1596,8 +1592,8 @@ class flat_multimap
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE flat_multimap()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: m_flat_tree()
{}
@@ -1605,7 +1601,7 @@ class flat_multimap
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE explicit flat_multimap(const allocator_type& a)
- : m_flat_tree(container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison
@@ -1622,7 +1618,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
flat_multimap(const Compare& comp, const allocator_type& a)
- : m_flat_tree(comp, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_multimap
@@ -1644,7 +1640,7 @@ class flat_multimap
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_multimap(InputIterator first, InputIterator last, const allocator_type& a)
- : m_flat_tree(false, first, last, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(false, first, last, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object
@@ -1666,7 +1662,7 @@ class flat_multimap
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_multimap(InputIterator first, InputIterator last, const Compare& comp, const allocator_type& a)
- : m_flat_tree(false, first, last, comp, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(false, first, last, comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_multimap
@@ -1723,8 +1719,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(std::initializer_list<value_type> il)
: m_flat_tree( false
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end())
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end())
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified
@@ -1735,9 +1731,9 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(std::initializer_list<value_type> il, const allocator_type& a)
: m_flat_tree(false
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
- , container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
+ , dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
@@ -1748,8 +1744,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(std::initializer_list<value_type> il, const Compare& comp)
: m_flat_tree(false
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end(), comp)
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end(), comp)
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
@@ -1760,9 +1756,9 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(std::initializer_list<value_type> il, const Compare& comp, const allocator_type& a)
: m_flat_tree( false
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
- , comp, container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
+ , comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_multimap and
@@ -1777,8 +1773,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(ordered_range_t, std::initializer_list<value_type> il)
: m_flat_tree( ordered_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end())
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end())
{}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
@@ -1793,8 +1789,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(ordered_range_t, std::initializer_list<value_type> il, const Compare& comp)
: m_flat_tree( ordered_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end(), comp)
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end(), comp)
{}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
@@ -1809,9 +1805,9 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
flat_multimap(ordered_range_t, std::initializer_list<value_type> il, const Compare& comp, const allocator_type& a)
: m_flat_tree( ordered_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end()
- , comp, container_detail::force<const impl_allocator_type>(a))
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end()
+ , comp, dtl::force<const impl_allocator_type>(a))
{}
#endif
@@ -1830,7 +1826,7 @@ class flat_multimap
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE
flat_multimap(BOOST_RV_REF(flat_multimap) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: m_flat_tree(boost::move(x.m_flat_tree))
{}
@@ -1839,7 +1835,7 @@ class flat_multimap
//! <b>Complexity</b>: Linear in x.size().
BOOST_CONTAINER_FORCEINLINE
flat_multimap(const flat_multimap& x, const allocator_type &a)
- : m_flat_tree(x.m_flat_tree, container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(x.m_flat_tree, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Move constructs a flat_multimap using the specified allocator.
@@ -1848,7 +1844,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
BOOST_CONTAINER_FORCEINLINE
flat_multimap(BOOST_RV_REF(flat_multimap) x, const allocator_type &a)
- : m_flat_tree(boost::move(x.m_flat_tree), container_detail::force<const impl_allocator_type>(a))
+ : m_flat_tree(boost::move(x.m_flat_tree), dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Makes *this a copy of x.
@@ -1865,7 +1861,7 @@ class flat_multimap
flat_multimap& operator=(BOOST_RV_REF(flat_multimap) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ m_flat_tree = boost::move(x.m_flat_tree); return *this; }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -1887,7 +1883,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
allocator_type get_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
+ { return dtl::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
//!
@@ -1898,7 +1894,7 @@ class flat_multimap
//! <b>Note</b>: Non-standard extension.
BOOST_CONTAINER_FORCEINLINE
stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
+ { return dtl::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
//!
@@ -1909,7 +1905,7 @@ class flat_multimap
//! <b>Note</b>: Non-standard extension.
BOOST_CONTAINER_FORCEINLINE
const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force<const stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
+ { return dtl::force<const stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
//////////////////////////////////////////////
//
@@ -1924,7 +1920,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
iterator begin() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.begin()); }
+ { return dtl::force_copy<iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
//!
@@ -1933,7 +1929,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.begin()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
//!
@@ -1942,7 +1938,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
iterator end() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.end()); }
+ { return dtl::force_copy<iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
//!
@@ -1951,7 +1947,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.end()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -1961,7 +1957,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
+ { return dtl::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -1971,7 +1967,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed container.
@@ -1981,7 +1977,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rend()); }
+ { return dtl::force_copy<reverse_iterator>(m_flat_tree.rend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed container.
@@ -1991,7 +1987,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
//!
@@ -2000,7 +1996,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.cbegin()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.cbegin()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
//!
@@ -2009,7 +2005,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_iterator>(m_flat_tree.cend()); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.cend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed container.
@@ -2019,7 +2015,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed container.
@@ -2029,7 +2025,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
+ { return dtl::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
//////////////////////////////////////////////
//
@@ -2101,22 +2097,22 @@ class flat_multimap
//! @copydoc ::boost::container::flat_set::nth(size_type)
BOOST_CONTAINER_FORCEINLINE
iterator nth(size_type n) BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.nth(n)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.nth(n)); }
//! @copydoc ::boost::container::flat_set::nth(size_type) const
BOOST_CONTAINER_FORCEINLINE
const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW
- { return container_detail::force_copy<iterator>(m_flat_tree.nth(n)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.nth(n)); }
//! @copydoc ::boost::container::flat_set::index_of(iterator)
BOOST_CONTAINER_FORCEINLINE
size_type index_of(iterator p) BOOST_NOEXCEPT_OR_NOTHROW
- { return m_flat_tree.index_of(container_detail::force_copy<impl_iterator>(p)); }
+ { return m_flat_tree.index_of(dtl::force_copy<impl_iterator>(p)); }
//! @copydoc ::boost::container::flat_set::index_of(const_iterator) const
BOOST_CONTAINER_FORCEINLINE
size_type index_of(const_iterator p) const BOOST_NOEXCEPT_OR_NOTHROW
- { return m_flat_tree.index_of(container_detail::force_copy<impl_const_iterator>(p)); }
+ { return m_flat_tree.index_of(dtl::force_copy<impl_const_iterator>(p)); }
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -2131,7 +2127,7 @@ class flat_multimap
template <class... Args>
BOOST_CONTAINER_FORCEINLINE
iterator emplace(BOOST_FWD_REF(Args)... args)
- { return container_detail::force_copy<iterator>(m_flat_tree.emplace_equal(boost::forward<Args>(args)...)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.emplace_equal(boost::forward<Args>(args)...)); }
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... in the container.
@@ -2149,8 +2145,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
{
- return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_equal
- (container_detail::force_copy<impl_const_iterator>(hint), boost::forward<Args>(args)...));
+ return dtl::force_copy<iterator>(m_flat_tree.emplace_hint_equal
+ (dtl::force_copy<impl_const_iterator>(hint), boost::forward<Args>(args)...));
}
#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
@@ -2158,13 +2154,13 @@ class flat_multimap
#define BOOST_CONTAINER_FLAT_MULTIMAP_EMPLACE_CODE(N) \
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE iterator emplace(BOOST_MOVE_UREF##N)\
- { return container_detail::force_copy<iterator>(m_flat_tree.emplace_equal(BOOST_MOVE_FWD##N)); }\
+ { return dtl::force_copy<iterator>(m_flat_tree.emplace_equal(BOOST_MOVE_FWD##N)); }\
\
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
BOOST_CONTAINER_FORCEINLINE iterator emplace_hint(const_iterator hint BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
- return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_equal\
- (container_detail::force_copy<impl_const_iterator>(hint) BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
+ return dtl::force_copy<iterator>(m_flat_tree.emplace_hint_equal\
+ (dtl::force_copy<impl_const_iterator>(hint) BOOST_MOVE_I##N BOOST_MOVE_FWD##N));\
}\
//
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_FLAT_MULTIMAP_EMPLACE_CODE)
@@ -2181,8 +2177,8 @@ class flat_multimap
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const value_type& x)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.insert_equal(container_detail::force<const impl_value_type>(x)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.insert_equal(dtl::force<const impl_value_type>(x)));
}
//! <b>Effects</b>: Inserts a new value move-constructed from x and returns
@@ -2193,7 +2189,7 @@ class flat_multimap
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(BOOST_RV_REF(value_type) x)
- { return container_detail::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
+ { return dtl::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
//! <b>Effects</b>: Inserts a new value move-constructed from x and returns
//! the iterator pointing to the newly inserted element.
@@ -2203,7 +2199,7 @@ class flat_multimap
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(BOOST_RV_REF(impl_value_type) x)
- { return container_detail::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
+ { return dtl::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
//! <b>Effects</b>: Inserts a copy of x in the container.
//! p is a hint pointing to where the insert should start to search.
@@ -2218,9 +2214,9 @@ class flat_multimap
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, const value_type& x)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.insert_equal( container_detail::force_copy<impl_const_iterator>(p)
- , container_detail::force<const impl_value_type>(x)));
+ return dtl::force_copy<iterator>
+ (m_flat_tree.insert_equal( dtl::force_copy<impl_const_iterator>(p)
+ , dtl::force<const impl_value_type>(x)));
}
//! <b>Effects</b>: Inserts a value move constructed from x in the container.
@@ -2236,8 +2232,8 @@ class flat_multimap
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.insert_equal(container_detail::force_copy<impl_const_iterator>(p)
+ return dtl::force_copy<iterator>
+ (m_flat_tree.insert_equal(dtl::force_copy<impl_const_iterator>(p)
, boost::move(x)));
}
@@ -2254,16 +2250,15 @@ class flat_multimap
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, BOOST_RV_REF(impl_value_type) x)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.insert_equal(container_detail::force_copy<impl_const_iterator>(p), boost::move(x)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.insert_equal(dtl::force_copy<impl_const_iterator>(p), boost::move(x)));
}
//! <b>Requires</b>: first, last are not iterators into *this.
//!
//! <b>Effects</b>: inserts each element from the range [first,last) .
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -2278,8 +2273,7 @@ class flat_multimap
//! if there is no element with key equivalent to the key of that element. This
//! function is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
//!
@@ -2291,14 +2285,13 @@ class flat_multimap
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()) .
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(std::initializer_list<value_type> il)
{
- m_flat_tree.insert_equal( container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end());
+ m_flat_tree.insert_equal( dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end());
}
//! <b>Requires</b>: [il.begin(), il.end()) must be ordered according to the predicate.
@@ -2307,8 +2300,7 @@ class flat_multimap
//! if there is no element with key equivalent to the key of that element. This
//! function is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
//!
@@ -2316,8 +2308,8 @@ class flat_multimap
BOOST_CONTAINER_FORCEINLINE void insert(ordered_range_t, std::initializer_list<value_type> il)
{
m_flat_tree.insert_equal( ordered_range
- , container_detail::force<impl_initializer_list>(il).begin()
- , container_detail::force<impl_initializer_list>(il).end());
+ , dtl::force<impl_initializer_list>(il).begin()
+ , dtl::force<impl_initializer_list>(il).end());
}
#endif
@@ -2365,8 +2357,8 @@ class flat_multimap
//! not less than the erased element.
BOOST_CONTAINER_FORCEINLINE iterator erase(const_iterator p)
{
- return container_detail::force_copy<iterator>(
- m_flat_tree.erase(container_detail::force_copy<impl_const_iterator>(p)));
+ return dtl::force_copy<iterator>(
+ m_flat_tree.erase(dtl::force_copy<impl_const_iterator>(p)));
}
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -2388,9 +2380,9 @@ class flat_multimap
//! linear to the elements with bigger keys.
BOOST_CONTAINER_FORCEINLINE iterator erase(const_iterator first, const_iterator last)
{
- return container_detail::force_copy<iterator>
- (m_flat_tree.erase( container_detail::force_copy<impl_const_iterator>(first)
- , container_detail::force_copy<impl_const_iterator>(last)));
+ return dtl::force_copy<iterator>
+ (m_flat_tree.erase( dtl::force_copy<impl_const_iterator>(first)
+ , dtl::force_copy<impl_const_iterator>(last)));
}
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -2400,7 +2392,7 @@ class flat_multimap
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE void swap(flat_multimap& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value )
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value )
{ m_flat_tree.swap(x.m_flat_tree); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
@@ -2422,14 +2414,14 @@ class flat_multimap
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE key_compare key_comp() const
- { return container_detail::force_copy<key_compare>(m_flat_tree.key_comp()); }
+ { return dtl::force_copy<key_compare>(m_flat_tree.key_comp()); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE value_compare value_comp() const
- { return value_compare(container_detail::force_copy<key_compare>(m_flat_tree.key_comp())); }
+ { return value_compare(dtl::force_copy<key_compare>(m_flat_tree.key_comp())); }
//////////////////////////////////////////////
//
@@ -2442,14 +2434,14 @@ class flat_multimap
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE iterator find(const key_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.find(x)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: An const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
BOOST_CONTAINER_FORCEINLINE const_iterator find(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.find(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
@@ -2462,40 +2454,40 @@ class flat_multimap
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE iterator lower_bound(const key_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
+ { return dtl::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key
//! not less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE const_iterator lower_bound(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE iterator upper_bound(const key_type& x)
- {return container_detail::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
+ {return dtl::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key
//! not less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE const_iterator upper_bound(const key_type& x) const
- { return container_detail::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
+ { return dtl::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE std::pair<iterator,iterator> equal_range(const key_type& x)
- { return container_detail::force_copy<std::pair<iterator,iterator> >(m_flat_tree.equal_range(x)); }
+ { return dtl::force_copy<std::pair<iterator,iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
BOOST_CONTAINER_FORCEINLINE std::pair<const_iterator, const_iterator> equal_range(const key_type& x) const
- { return container_detail::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.equal_range(x)); }
+ { return dtl::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Extracts the internal sequence container.
//!
@@ -2506,7 +2498,7 @@ class flat_multimap
//! <b>Throws</b>: If secuence_type's move constructor throws
BOOST_CONTAINER_FORCEINLINE sequence_type extract_sequence()
{
- return boost::move(container_detail::force<sequence_type>(m_flat_tree.get_sequence_ref()));
+ return boost::move(dtl::force<sequence_type>(m_flat_tree.get_sequence_ref()));
}
//! <b>Effects</b>: Discards the internally hold sequence container and adopts the
@@ -2516,7 +2508,7 @@ class flat_multimap
//!
//! <b>Throws</b>: If the comparison or the move constructor throws
BOOST_CONTAINER_FORCEINLINE void adopt_sequence(BOOST_RV_REF(sequence_type) seq)
- { this->m_flat_tree.adopt_sequence_equal(boost::move(container_detail::force<impl_sequence_type>(seq))); }
+ { this->m_flat_tree.adopt_sequence_equal(boost::move(dtl::force<impl_sequence_type>(seq))); }
//! <b>Requires</b>: seq shall be ordered according to this->compare().
//!
@@ -2527,7 +2519,7 @@ class flat_multimap
//!
//! <b>Throws</b>: If the move assignment throws
BOOST_CONTAINER_FORCEINLINE void adopt_sequence(ordered_range_t, BOOST_RV_REF(sequence_type) seq)
- { this->m_flat_tree.adopt_sequence_equal(ordered_range_t(), boost::move(container_detail::force<impl_sequence_type>(seq))); }
+ { this->m_flat_tree.adopt_sequence_equal(ordered_range_t(), boost::move(dtl::force<impl_sequence_type>(seq))); }
//! <b>Effects</b>: Returns true if x and y are equal
//!
diff --git a/boost/container/flat_set.hpp b/boost/container/flat_set.hpp
index 567fec95db..59ab57361f 100644
--- a/boost/container/flat_set.hpp
+++ b/boost/container/flat_set.hpp
@@ -80,13 +80,13 @@ template <class Key, class Compare, class AllocatorOrContainer>
#endif
class flat_set
///@cond
- : public container_detail::flat_tree<Key, container_detail::identity<Key>, Compare, AllocatorOrContainer>
+ : public dtl::flat_tree<Key, dtl::identity<Key>, Compare, AllocatorOrContainer>
///@endcond
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(flat_set)
- typedef container_detail::flat_tree<Key, container_detail::identity<Key>, Compare, AllocatorOrContainer> tree_t;
+ typedef dtl::flat_tree<Key, dtl::identity<Key>, Compare, AllocatorOrContainer> tree_t;
public:
tree_t &tree()
@@ -134,8 +134,8 @@ class flat_set
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
- flat_set() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ flat_set() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: tree_t()
{}
@@ -350,7 +350,7 @@ class flat_set
//!
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE flat_set(BOOST_RV_REF(flat_set) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: tree_t(BOOST_MOVE_BASE(tree_t, x))
{}
@@ -384,7 +384,7 @@ class flat_set
BOOST_CONTAINER_FORCEINLINE flat_set& operator=(BOOST_RV_REF(flat_set) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<flat_set&>(this->tree_t::operator=(BOOST_MOVE_BASE(tree_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -687,8 +687,7 @@ class flat_set
//! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -702,8 +701,7 @@ class flat_set
//! <b>Effects</b>: inserts each element from the range [first,last) .This function
//! is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -714,8 +712,7 @@ class flat_set
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()) if and only
//! if there is no element with key equivalent to the key of that element.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from il.begin() to il.end())
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(std::initializer_list<value_type> il)
@@ -727,8 +724,7 @@ class flat_set
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()) .This function
//! is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from il.begin() to il.end())
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(ordered_unique_range_t, std::initializer_list<value_type> il)
@@ -794,7 +790,7 @@ class flat_set
//! <b>Complexity</b>: Constant.
void swap(flat_set& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value );
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value );
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
@@ -1052,13 +1048,13 @@ template <class Key, class Compare, class AllocatorOrContainer>
#endif
class flat_multiset
///@cond
- : public container_detail::flat_tree<Key, container_detail::identity<Key>, Compare, AllocatorOrContainer>
+ : public dtl::flat_tree<Key, dtl::identity<Key>, Compare, AllocatorOrContainer>
///@endcond
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(flat_multiset)
- typedef container_detail::flat_tree<Key, container_detail::identity<Key>, Compare, AllocatorOrContainer> tree_t;
+ typedef dtl::flat_tree<Key, dtl::identity<Key>, Compare, AllocatorOrContainer> tree_t;
public:
tree_t &tree()
@@ -1095,8 +1091,8 @@ class flat_multiset
typedef typename sequence_type::const_reverse_iterator const_reverse_iterator;
//! @copydoc ::boost::container::flat_set::flat_set()
- BOOST_CONTAINER_FORCEINLINE flat_multiset() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_CONTAINER_FORCEINLINE flat_multiset() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<AllocatorOrContainer>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: tree_t()
{}
@@ -1249,7 +1245,7 @@ class flat_multiset
//! @copydoc ::boost::container::flat_set::flat_set(flat_set &&)
BOOST_CONTAINER_FORCEINLINE flat_multiset(BOOST_RV_REF(flat_multiset) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: tree_t(boost::move(static_cast<tree_t&>(x)))
{}
@@ -1271,7 +1267,7 @@ class flat_multiset
BOOST_CONTAINER_FORCEINLINE flat_multiset& operator=(BOOST_RV_REF(flat_multiset) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<flat_multiset&>(this->tree_t::operator=(BOOST_MOVE_BASE(tree_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -1456,8 +1452,7 @@ class flat_multiset
//!
//! <b>Effects</b>: inserts each element from the range [first,last) .
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -1470,8 +1465,7 @@ class flat_multiset
//! <b>Effects</b>: inserts each element from the range [first,last) .This function
//! is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
template <class InputIterator>
@@ -1481,8 +1475,7 @@ class flat_multiset
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()).
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: N log(N).
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(std::initializer_list<value_type> il)
@@ -1493,8 +1486,7 @@ class flat_multiset
//! <b>Effects</b>: inserts each element from the range [il.begin(), il.end()). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
- //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from il.begin() to il.end())
- //! search time plus N*size() insertion time.
+ //! <b>Complexity</b>: Linear.
//!
//! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
BOOST_CONTAINER_FORCEINLINE void insert(ordered_range_t, std::initializer_list<value_type> il)
@@ -1535,7 +1527,7 @@ class flat_multiset
//! @copydoc ::boost::container::flat_set::swap
void swap(flat_multiset& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value );
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value );
//! @copydoc ::boost::container::flat_set::clear
void clear() BOOST_NOEXCEPT_OR_NOTHROW;
diff --git a/boost/container/list.hpp b/boost/container/list.hpp
index f779cc4553..c74372f858 100644
--- a/boost/container/list.hpp
+++ b/boost/container/list.hpp
@@ -33,6 +33,7 @@
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/node_alloc_holder.hpp>
#include <boost/container/detail/version_type.hpp>
+#include <boost/container/detail/value_functors.hpp>
// move
#include <boost/move/utility_core.hpp>
#include <boost/move/iterator.hpp>
@@ -57,13 +58,13 @@ namespace boost {
namespace container {
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
+namespace dtl {
template<class VoidPointer>
struct list_hook
{
- typedef typename container_detail::bi::make_list_base_hook
- <container_detail::bi::void_pointer<VoidPointer>, container_detail::bi::link_mode<container_detail::bi::normal_link> >::type type;
+ typedef typename dtl::bi::make_list_base_hook
+ <dtl::bi::void_pointer<VoidPointer>, dtl::bi::link_mode<dtl::bi::normal_link> >::type type;
};
template <class T, class VoidPointer>
@@ -100,19 +101,19 @@ struct intrusive_list_type
<typename allocator_traits_type::pointer>::template
rebind_pointer<void>::type
void_pointer;
- typedef typename container_detail::list_node
+ typedef typename dtl::list_node
<value_type, void_pointer> node_type;
- typedef typename container_detail::bi::make_list
+ typedef typename dtl::bi::make_list
< node_type
- , container_detail::bi::base_hook<typename list_hook<void_pointer>::type>
- , container_detail::bi::constant_time_size<true>
- , container_detail::bi::size_type
+ , dtl::bi::base_hook<typename list_hook<void_pointer>::type>
+ , dtl::bi::constant_time_size<true>
+ , dtl::bi::size_type
<typename allocator_traits_type::size_type>
>::type container_type;
typedef container_type type ;
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
//! A list is a doubly linked list. That is, it is a Sequence that supports both
@@ -134,26 +135,26 @@ template <class T, class Allocator = new_allocator<T> >
template <class T, class Allocator>
#endif
class list
- : protected container_detail::node_alloc_holder
- <Allocator, typename container_detail::intrusive_list_type<Allocator>::type>
+ : protected dtl::node_alloc_holder
+ <Allocator, typename dtl::intrusive_list_type<Allocator>::type>
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
typedef typename
- container_detail::intrusive_list_type<Allocator>::type Icont;
- typedef container_detail::node_alloc_holder<Allocator, Icont> AllocHolder;
+ dtl::intrusive_list_type<Allocator>::type Icont;
+ typedef dtl::node_alloc_holder<Allocator, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
typedef typename AllocHolder::NodeAlloc NodeAlloc;
typedef typename AllocHolder::ValAlloc ValAlloc;
typedef typename AllocHolder::Node Node;
- typedef container_detail::allocator_destroyer<NodeAlloc> Destroyer;
+ typedef dtl::allocator_destroyer<NodeAlloc> Destroyer;
typedef typename AllocHolder::alloc_version alloc_version;
typedef boost::container::allocator_traits<Allocator> allocator_traits_type;
typedef boost::container::equal_to_value<Allocator> equal_to_value_type;
BOOST_COPYABLE_AND_MOVABLE(list)
- typedef container_detail::iterator_from_iiterator<typename Icont::iterator, false> iterator_impl;
- typedef container_detail::iterator_from_iiterator<typename Icont::iterator, true> const_iterator_impl;
+ typedef dtl::iterator_from_iiterator<typename Icont::iterator, false> iterator_impl;
+ typedef dtl::iterator_from_iiterator<typename Icont::iterator, true> const_iterator_impl;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -188,7 +189,7 @@ class list
//! <b>Throws</b>: If allocator_type's default constructor throws.
//!
//! <b>Complexity</b>: Constant.
- list() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ list() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: AllocHolder()
{}
@@ -331,7 +332,7 @@ class list
if (&x != this){
NodeAlloc &this_alloc = this->node_alloc();
const NodeAlloc &x_alloc = x.node_alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
@@ -417,7 +418,7 @@ class list
template <class InpIt>
void assign(InpIt first, InpIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_convertible<InpIt, size_type>::type * = 0
+ , typename dtl::disable_if_convertible<InpIt, size_type>::type * = 0
#endif
)
{
@@ -866,10 +867,10 @@ class list
template <class InpIt>
iterator insert(const_iterator p, InpIt first, InpIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < !container_detail::is_convertible<InpIt, size_type>::value
- && (container_detail::is_input_iterator<InpIt>::value
- || container_detail::is_same<alloc_version, version_1>::value
+ , typename dtl::enable_if_c
+ < !dtl::is_convertible<InpIt, size_type>::value
+ && (dtl::is_input_iterator<InpIt>::value
+ || dtl::is_same<alloc_version, version_1>::value
)
>::type * = 0
#endif
@@ -891,10 +892,10 @@ class list
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class FwdIt>
iterator insert(const_iterator position, FwdIt first, FwdIt last
- , typename container_detail::enable_if_c
- < !container_detail::is_convertible<FwdIt, size_type>::value
- && !(container_detail::is_input_iterator<FwdIt>::value
- || container_detail::is_same<alloc_version, version_1>::value
+ , typename dtl::enable_if_c
+ < !dtl::is_convertible<FwdIt, size_type>::value
+ && !(dtl::is_input_iterator<FwdIt>::value
+ || dtl::is_same<alloc_version, version_1>::value
)
>::type * = 0
)
@@ -1204,7 +1205,7 @@ class list
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
- { this->unique(value_equal()); }
+ { this->unique(value_equal_t()); }
//! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
@@ -1234,7 +1235,7 @@ class list
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
void merge(list &x)
- { this->merge(x, value_less()); }
+ { this->merge(x, value_less_t()); }
//! <b>Requires</b>: The lists x and *this must be distinct.
//!
@@ -1300,7 +1301,7 @@ class list
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
void sort()
- { this->sort(value_less()); }
+ { this->sort(value_less_t()); }
//! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
@@ -1457,18 +1458,8 @@ class list
}
};
- //Functors for member algorithm defaults
- struct value_less
- {
- bool operator()(const value_type &a, const value_type &b) const
- { return a < b; }
- };
-
- struct value_equal
- {
- bool operator()(const value_type &a, const value_type &b) const
- { return a == b; }
- };
+ typedef value_less<value_type> value_less_t;
+ typedef value_equal<value_type> value_equal_t;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
diff --git a/boost/container/map.hpp b/boost/container/map.hpp
index 33e0331eb0..63e10b4af0 100644
--- a/boost/container/map.hpp
+++ b/boost/container/map.hpp
@@ -78,9 +78,9 @@ template <class Key, class T, class Compare, class Allocator, class Options>
#endif
class map
///@cond
- : public container_detail::tree
+ : public dtl::tree
< std::pair<const Key, T>
- , container_detail::select1st<Key>
+ , dtl::select1st<Key>
, Compare, Allocator, Options>
///@endcond
{
@@ -88,11 +88,11 @@ class map
private:
BOOST_COPYABLE_AND_MOVABLE(map)
- typedef container_detail::select1st<Key> select_1st_t;
+ typedef dtl::select1st<Key> select_1st_t;
typedef std::pair<const Key, T> value_type_impl;
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, Compare, Allocator, Options> base_t;
- typedef container_detail::pair <Key, T> movable_value_type_impl;
+ typedef dtl::pair <Key, T> movable_value_type_impl;
typedef typename base_t::value_compare value_compare_impl;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -131,7 +131,7 @@ class map
(insert_return_type_base<iterator BOOST_MOVE_I node_type>) insert_return_type;
//allocator_type::value_type type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<typename allocator_type::value_type, std::pair<const Key, T> >::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<typename allocator_type::value_type, std::pair<const Key, T> >::value));
//////////////////////////////////////////////
//
@@ -143,8 +143,8 @@ class map
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE
- map() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ map() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: base_t()
{}
@@ -350,7 +350,7 @@ class map
//!
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE map(BOOST_RV_REF(map) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: base_t(BOOST_MOVE_BASE(base_t, x))
{}
@@ -388,7 +388,7 @@ class map
BOOST_CONTAINER_FORCEINLINE map& operator=(BOOST_RV_REF(map) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<map&>(this->base_t::operator=(BOOST_MOVE_BASE(base_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -1014,7 +1014,7 @@ class map
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(map<Key, T, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, C2, Allocator, Options> base2_t;
this->merge_unique(static_cast<base2_t&>(source));
}
@@ -1028,7 +1028,7 @@ class map
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(multimap<Key, T, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, C2, Allocator, Options> base2_t;
this->base_t::merge_unique(static_cast<base2_t&>(source));
}
@@ -1046,7 +1046,7 @@ class map
//! <b>Complexity</b>: Constant.
void swap(map& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value )
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value )
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
@@ -1219,9 +1219,9 @@ template <class Key, class T, class Compare, class Allocator, class Options>
#endif
class multimap
///@cond
- : public container_detail::tree
+ : public dtl::tree
< std::pair<const Key, T>
- , container_detail::select1st<Key>
+ , dtl::select1st<Key>
, Compare, Allocator, Options>
///@endcond
{
@@ -1229,11 +1229,11 @@ class multimap
private:
BOOST_COPYABLE_AND_MOVABLE(multimap)
- typedef container_detail::select1st<Key> select_1st_t;
+ typedef dtl::select1st<Key> select_1st_t;
typedef std::pair<const Key, T> value_type_impl;
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, Compare, Allocator, Options> base_t;
- typedef container_detail::pair <Key, T> movable_value_type_impl;
+ typedef dtl::pair <Key, T> movable_value_type_impl;
typedef typename base_t::value_compare value_compare_impl;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -1271,7 +1271,7 @@ class multimap
<key_type BOOST_MOVE_I mapped_type> >) node_type;
//allocator_type::value_type type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<typename allocator_type::value_type, std::pair<const Key, T> >::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<typename allocator_type::value_type, std::pair<const Key, T> >::value));
//////////////////////////////////////////////
//
@@ -1283,8 +1283,8 @@ class multimap
//!
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE multimap()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: base_t()
{}
@@ -1486,7 +1486,7 @@ class multimap
//!
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE multimap(BOOST_RV_REF(multimap) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: base_t(BOOST_MOVE_BASE(base_t, x))
{}
@@ -1518,7 +1518,7 @@ class multimap
BOOST_CONTAINER_FORCEINLINE multimap& operator=(BOOST_RV_REF(multimap) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<multimap&>(this->base_t::operator=(BOOST_MOVE_BASE(base_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -1790,7 +1790,7 @@ class multimap
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(multimap<Key, T, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, C2, Allocator, Options> base2_t;
this->base_t::merge_equal(static_cast<base2_t&>(source));
}
@@ -1804,7 +1804,7 @@ class multimap
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(map<Key, T, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
+ typedef dtl::tree
<value_type_impl, select_1st_t, C2, Allocator, Options> base2_t;
this->base_t::merge_equal(static_cast<base2_t&>(source));
}
@@ -1818,7 +1818,7 @@ class multimap
//! @copydoc ::boost::container::set::swap
void swap(multiset& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value );
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value );
//! @copydoc ::boost::container::set::clear
void clear() BOOST_NOEXCEPT_OR_NOTHROW;
diff --git a/boost/container/node_allocator.hpp b/boost/container/node_allocator.hpp
index 7a6988c4b0..b5c20a65d1 100644
--- a/boost/container/node_allocator.hpp
+++ b/boost/container/node_allocator.hpp
@@ -74,19 +74,19 @@ class node_allocator
typedef T * pointer;
typedef const T * const_pointer;
typedef typename ::boost::container::
- container_detail::unvoid_ref<T>::type reference;
+ dtl::unvoid_ref<T>::type reference;
typedef typename ::boost::container::
- container_detail::unvoid_ref<const T>::type const_reference;
+ dtl::unvoid_ref<const T>::type const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
version_type<self_t, Version> version;
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
basic_multiallocation_chain<void*> multiallocation_chain_void;
- typedef boost::container::container_detail::
+ typedef boost::container::dtl::
transform_multiallocation_chain
<multiallocation_chain_void, T> multiallocation_chain;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -148,9 +148,9 @@ class node_allocator
boost::container::throw_bad_alloc();
if(Version == 1 && count == 1){
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
return pointer(static_cast<T*>(singleton_t::instance().allocate_node()));
}
else{
@@ -167,9 +167,9 @@ class node_allocator
{
(void)count;
if(Version == 1 && count == 1){
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_node(ptr);
}
else{
@@ -180,9 +180,9 @@ class node_allocator
//!Deallocates all free blocks of the pool
static void deallocate_free_blocks() BOOST_NOEXCEPT_OR_NOTHROW
{
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_free_blocks();
}
@@ -210,9 +210,9 @@ class node_allocator
pointer allocate_one()
{
BOOST_STATIC_ASSERT(( Version > 1 ));
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
return (pointer)singleton_t::instance().allocate_node();
}
@@ -221,9 +221,9 @@ class node_allocator
void allocate_individual(std::size_t num_elements, multiallocation_chain &chain)
{
BOOST_STATIC_ASSERT(( Version > 1 ));
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
typename shared_pool_t::multiallocation_chain ch;
singleton_t::instance().allocate_nodes(num_elements, ch);
chain.incorporate_after(chain.before_begin(), (T*)&*ch.begin(), (T*)&*ch.last(), ch.size());
@@ -235,18 +235,18 @@ class node_allocator
void deallocate_one(pointer p) BOOST_NOEXCEPT_OR_NOTHROW
{
BOOST_STATIC_ASSERT(( Version > 1 ));
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
singleton_t::instance().deallocate_node(p);
}
void deallocate_individual(multiallocation_chain &chain) BOOST_NOEXCEPT_OR_NOTHROW
{
BOOST_STATIC_ASSERT(( Version > 1 ));
- typedef container_detail::shared_node_pool
+ typedef dtl::shared_node_pool
<sizeof(T), NodesPerBlock> shared_pool_t;
- typedef container_detail::singleton_default<shared_pool_t> singleton_t;
+ typedef dtl::singleton_default<shared_pool_t> singleton_t;
typename shared_pool_t::multiallocation_chain ch(&*chain.begin(), &*chain.last(), chain.size());
singleton_t::instance().deallocate_nodes(ch);
}
diff --git a/boost/container/node_handle.hpp b/boost/container/node_handle.hpp
index 594a09c99e..ef1d71f355 100644
--- a/boost/container/node_handle.hpp
+++ b/boost/container/node_handle.hpp
@@ -174,9 +174,9 @@ class node_handle
//! of a node handle is void.
template<class KeyMapped2>
node_handle( BOOST_RV_REF_BEG node_handle<NodeAllocator, KeyMapped2> BOOST_RV_REF_END nh
- , typename container_detail::enable_if_c
- < ((unsigned)container_detail::is_same<KeyMapped, void>::value +
- (unsigned)container_detail::is_same<KeyMapped2, void>::value) == 1u
+ , typename dtl::enable_if_c
+ < ((unsigned)dtl::is_same<KeyMapped, void>::value +
+ (unsigned)dtl::is_same<KeyMapped2, void>::value) == 1u
>::type* = 0) BOOST_NOEXCEPT
: m_ptr(nh.get())
{ this->move_construct_end(nh); }
@@ -250,7 +250,7 @@ class node_handle
//! <b>Throws</b>: Nothing.
value_type& value() const BOOST_NOEXCEPT
{
- BOOST_STATIC_ASSERT((container_detail::is_same<KeyMapped, void>::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<KeyMapped, void>::value));
BOOST_ASSERT(!empty());
return m_ptr->get_data();
}
@@ -265,7 +265,7 @@ class node_handle
//! <b>Requires</b>: Modifying the key through the returned reference is permitted.
key_type& key() const BOOST_NOEXCEPT
{
- BOOST_STATIC_ASSERT((!container_detail::is_same<KeyMapped, void>::value));
+ BOOST_STATIC_ASSERT((!dtl::is_same<KeyMapped, void>::value));
BOOST_ASSERT(!empty());
return const_cast<key_type &>(KeyMapped().key_of_value(m_ptr->get_data()));
}
@@ -278,7 +278,7 @@ class node_handle
//! <b>Throws</b>: Nothing.
mapped_type& mapped() const BOOST_NOEXCEPT
{
- BOOST_STATIC_ASSERT((!container_detail::is_same<KeyMapped, void>::value));
+ BOOST_STATIC_ASSERT((!dtl::is_same<KeyMapped, void>::value));
BOOST_ASSERT(!empty());
return KeyMapped().mapped_of_value(m_ptr->get_data());
}
diff --git a/boost/container/options.hpp b/boost/container/options.hpp
index da8b6a7952..2ac7783e46 100644
--- a/boost/container/options.hpp
+++ b/boost/container/options.hpp
@@ -28,6 +28,24 @@
namespace boost {
namespace container {
+////////////////////////////////////////////////////////////////
+//
+//
+// OPTIONS FOR ASSOCIATIVE TREE-BASED CONTAINERS
+//
+//
+////////////////////////////////////////////////////////////////
+
+//! Enumeration used to configure ordered associative containers
+//! with a concrete tree implementation.
+enum tree_type_enum
+{
+ red_black_tree,
+ avl_tree,
+ scapegoat_tree,
+ splay_tree
+};
+
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template<tree_type_enum TreeType, bool OptimizeSize>
@@ -37,6 +55,8 @@ struct tree_opt
static const bool optimize_size = OptimizeSize;
};
+typedef tree_opt<red_black_tree, true> tree_assoc_defaults;
+
#endif //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//!This option setter specifies the underlying tree type
@@ -72,6 +92,151 @@ struct tree_assoc_options
typedef implementation_defined type;
};
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+
+//! Helper alias metafunction to combine options into a single type to be used
+//! by tree-based associative containers
+template<class ...Options>
+using tree_assoc_options_t = typename boost::container::tree_assoc_options<Options...>::type;
+
+#endif
+
+////////////////////////////////////////////////////////////////
+//
+//
+// OPTIONS FOR VECTOR-BASED CONTAINERS
+//
+//
+////////////////////////////////////////////////////////////////
+
+#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+template<class AllocTraits, class StoredSizeType>
+struct get_stored_size_type_with_alloctraits
+{
+ typedef StoredSizeType type;
+};
+
+template<class AllocTraits>
+struct get_stored_size_type_with_alloctraits<AllocTraits, void>
+{
+ typedef typename AllocTraits::size_type type;
+};
+
+template<class GrowthType, class StoredSizeType>
+struct vector_opt
+{
+ typedef GrowthType growth_factor_type;
+ typedef StoredSizeType stored_size_type;
+
+ template<class AllocTraits>
+ struct get_stored_size_type
+ : get_stored_size_type_with_alloctraits<AllocTraits, StoredSizeType>
+ {};
+};
+
+class default_next_capacity;
+
+typedef vector_opt<void, void> vector_null_opt;
+
+#else //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+//!This growth factor argument specifies that the container should increase it's
+//!capacity a 50% when existing capacity is exhausted.
+struct growth_factor_50{};
+
+//!This growth factor argument specifies that the container should increase it's
+//!capacity a 60% when existing capacity is exhausted.
+struct growth_factor_60{};
+
+//!This growth factor argument specifies that the container should increase it's
+//!capacity a 100% (doubling its capacity) when existing capacity is exhausted.
+struct growth_factor_100{};
+
+#endif //!defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+//!This option setter specifies the growth factor strategy of the underlying vector.
+//!
+//!\tparam GrowthFactor A function object that has the following signature:<br/><br/>
+//!`template<class SizeType>`<br/>
+//!`SizeType operator()(SizeType cur_cap, SizeType add_min_cap, SizeType max_cap) const;`.<br/><br/>
+//!`cur_cap` is the current capacity, `add_min_cap` is the minimum additional capacity
+//!we want to achieve and `max_cap` is the maximum capacity that the allocator or other
+//!factors allow. The implementation should return a value between `cur_cap` + `add_min_cap`
+//!and `max_cap`. `cur_cap` + `add_min_cap` is guaranteed not to overflow/wraparound,
+//! but the implementation should handle wraparound produced by the growth factor.
+//!
+//!Predefined growth factors that can be passed as arguments to this option are:
+//!\c boost::container::growth_factor_50
+//!\c boost::container::growth_factor_60
+//!\c boost::container::growth_factor_100
+//!
+//!If this option is not specified, a default will be used by the container.
+BOOST_INTRUSIVE_OPTION_TYPE(growth_factor, GrowthFactor, GrowthFactor, growth_factor_type)
+
+//!This option specifies the unsigned integer type that a user wants the container
+//!to use to hold size-related information inside a container (e.g. current size, current capacity).
+//!
+//!\tparam StoredSizeType A unsigned integer type. It shall be smaller than than the size
+//! of the size_type deduced from `allocator_traits<A>::size_type` or the same type.
+//!
+//!If the maximum capacity() to be used is limited, a user can try to use 8-bit, 16-bit
+//!(e.g. in 32-bit machines), or 32-bit size types (e.g. in a 64 bit machine) to see if some
+//!memory can be saved for empty vectors. This could potentially performance benefits due to better
+//!cache usage.
+//!
+//!Note that alignment requirements can disallow theoritical space savings. Example:
+//!\c vector holds a pointer and two size types (for size and capacity), in a 32 bit machine
+//!a 8 bit size type (total size: 4 byte pointer + 2 x 1 byte sizes = 6 bytes)
+//!will not save space when comparing two 16-bit size types because usually
+//!a 32 bit alignment is required for vector and the size will be rounded to 8 bytes. In a 64-bit
+//!machine a 16 bit size type does not usually save memory when comparing to a 32-bit size type.
+//!Measure the size of the resulting container and do not assume a smaller \c stored_size
+//!will always lead to a smaller sizeof(container).
+//!
+//!If a user tries to insert more elements than representable by \c stored_size, vector
+//!will throw a length_error.
+//!
+//!If this option is not specified, `allocator_traits<A>::size_type` (usually std::size_t) will
+//!be used to store size-related information inside the container.
+BOOST_INTRUSIVE_OPTION_TYPE(stored_size, StoredSizeType, StoredSizeType, stored_size_type)
+
+//! Helper metafunction to combine options into a single type to be used
+//! by \c boost::container::vector.
+//! Supported options are: \c boost::container::growth_factor and \c boost::container::stored_size
+#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 vector_options
+{
+ /// @cond
+ typedef typename ::boost::intrusive::pack_options
+ < vector_null_opt,
+ #if !defined(BOOST_CONTAINER_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef vector_opt< typename packed_options::growth_factor_type
+ , typename packed_options::stored_size_type> implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+
+//! Helper alias metafunction to combine options into a single type to be used
+//! by \c boost::container::vector.
+//! Supported options are: \c boost::container::growth_factor and \c boost::container::stored_size
+template<class ...Options>
+using vector_options_t = typename boost::container::vector_options<Options...>::type;
+
+#endif
+
+
} //namespace container {
} //namespace boost {
diff --git a/boost/container/pmr/flat_map.hpp b/boost/container/pmr/flat_map.hpp
index 150d5332f2..76c697bac4 100644
--- a/boost/container/pmr/flat_map.hpp
+++ b/boost/container/pmr/flat_map.hpp
@@ -26,14 +26,12 @@ namespace pmr {
template <class Key
,class T
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key > >
using flat_map = boost::container::flat_map<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > >;
template <class Key
,class T
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
using flat_multimap = boost::container::flat_multimap<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > >;
#endif
@@ -42,8 +40,7 @@ using flat_multimap = boost::container::flat_multimap<Key, T, Compare, polymorph
//! that uses a polymorphic allocator
template <class Key
,class T
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
struct flat_map_of
{
typedef boost::container::flat_map<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > > type;
@@ -53,8 +50,7 @@ struct flat_map_of
//! that uses a polymorphic allocator
template <class Key
,class T
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
struct flat_multimap_of
{
typedef boost::container::flat_multimap<Key, T, Compare, polymorphic_allocator<std::pair<Key, T> > > type;
diff --git a/boost/container/pmr/flat_set.hpp b/boost/container/pmr/flat_set.hpp
index 6d4292bfb4..f072c95139 100644
--- a/boost/container/pmr/flat_set.hpp
+++ b/boost/container/pmr/flat_set.hpp
@@ -25,13 +25,11 @@ namespace pmr {
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template <class Key
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
using flat_set = boost::container::flat_set<Key, Compare, polymorphic_allocator<Key> >;
template <class Key
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
using flat_multiset = boost::container::flat_multiset<Key, Compare, polymorphic_allocator<Key> >;
#endif
@@ -39,8 +37,7 @@ using flat_multiset = boost::container::flat_multiset<Key, Compare, polymorphic_
//! A portable metafunction to obtain a flat_set
//! that uses a polymorphic allocator
template <class Key
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
struct flat_set_of
{
typedef boost::container::flat_set<Key, Compare, polymorphic_allocator<Key> > type;
@@ -49,8 +46,7 @@ struct flat_set_of
//! A portable metafunction to obtain a flat_multiset
//! that uses a polymorphic allocator
template <class Key
- ,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Compare = std::less<Key> >
struct flat_multiset_of
{
typedef boost::container::flat_multiset<Key, Compare, polymorphic_allocator<Key> > type;
diff --git a/boost/container/pmr/map.hpp b/boost/container/pmr/map.hpp
index 165a473373..71821606ae 100644
--- a/boost/container/pmr/map.hpp
+++ b/boost/container/pmr/map.hpp
@@ -27,13 +27,13 @@ namespace pmr {
template <class Key
,class T
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
using map = boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>;
template <class Key
,class T
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
using multimap = boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>;
#endif
@@ -43,7 +43,7 @@ using multimap = boost::container::multimap<Key, T, Compare, polymorphic_allocat
template <class Key
,class T
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
struct map_of
{
typedef boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type;
@@ -54,7 +54,7 @@ struct map_of
template <class Key
,class T
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
struct multimap_of
{
typedef boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type;
diff --git a/boost/container/pmr/polymorphic_allocator.hpp b/boost/container/pmr/polymorphic_allocator.hpp
index c446bc8d5b..8c04653213 100644
--- a/boost/container/pmr/polymorphic_allocator.hpp
+++ b/boost/container/pmr/polymorphic_allocator.hpp
@@ -104,7 +104,7 @@ class polymorphic_allocator
void construct(U* p, BOOST_FWD_REF(Args)...args)
{
new_allocator<U> na;
- container_detail::dispatch_uses_allocator
+ dtl::dispatch_uses_allocator
(na, *this, p, ::boost::forward<Args>(args)...);
}
@@ -117,7 +117,7 @@ class polymorphic_allocator
void construct(U* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
{\
new_allocator<U> na;\
- container_detail::dispatch_uses_allocator\
+ dtl::dispatch_uses_allocator\
(na, *this, p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
}\
//
diff --git a/boost/container/pmr/resource_adaptor.hpp b/boost/container/pmr/resource_adaptor.hpp
index deece632e8..f5ce5c8a18 100644
--- a/boost/container/pmr/resource_adaptor.hpp
+++ b/boost/container/pmr/resource_adaptor.hpp
@@ -57,7 +57,7 @@ class resource_adaptor_imp
void static_assert_if_not_char_allocator() const
{
//This class can only be used with allocators type char
- BOOST_STATIC_ASSERT((container_detail::is_same<typename Allocator::value_type, char>::value));
+ BOOST_STATIC_ASSERT((dtl::is_same<typename Allocator::value_type, char>::value));
}
#endif
diff --git a/boost/container/pmr/set.hpp b/boost/container/pmr/set.hpp
index 04583ce2dd..320169667f 100644
--- a/boost/container/pmr/set.hpp
+++ b/boost/container/pmr/set.hpp
@@ -26,12 +26,12 @@ namespace pmr {
template <class Key
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
using set = boost::container::set<Key, Compare, polymorphic_allocator<Key>, Options>;
template <class Key
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
using multiset = boost::container::multiset<Key, Compare, polymorphic_allocator<Key>, Options>;
#endif
@@ -40,7 +40,7 @@ using multiset = boost::container::multiset<Key, Compare, polymorphic_allocator<
//! that uses a polymorphic allocator
template <class Key
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
struct set_of
{
typedef boost::container::set<Key, Compare, polymorphic_allocator<Key>, Options> type;
@@ -50,7 +50,7 @@ struct set_of
//! that uses a polymorphic allocator
template <class Key
,class Compare = std::less<Key>
- ,class Options = tree_assoc_defaults >
+ ,class Options = void >
struct multiset_of
{
typedef boost::container::multiset<Key, Compare, polymorphic_allocator<Key>, Options> type;
diff --git a/boost/container/scoped_allocator.hpp b/boost/container/scoped_allocator.hpp
index 6a041a653d..6cd69fe430 100644
--- a/boost/container/scoped_allocator.hpp
+++ b/boost/container/scoped_allocator.hpp
@@ -44,7 +44,7 @@ namespace boost { namespace container {
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
+namespace dtl {
template <typename Allocator>
struct is_scoped_allocator_imp
@@ -99,16 +99,16 @@ struct outermost_allocator_imp<MaybeScopedAlloc, true>
{ return outermost_allocator_imp<outer_type>::get(a.outer_allocator()); }
};
-} //namespace container_detail {
+} //namespace dtl {
template <typename Allocator>
struct is_scoped_allocator
- : container_detail::is_scoped_allocator_imp<Allocator>
+ : dtl::is_scoped_allocator_imp<Allocator>
{};
template <typename Allocator>
struct outermost_allocator
- : container_detail::outermost_allocator_imp<Allocator>
+ : dtl::outermost_allocator_imp<Allocator>
{};
template <typename Allocator>
@@ -121,7 +121,7 @@ const typename outermost_allocator<Allocator>::type &
get_outermost_allocator(const Allocator &a)
{ return outermost_allocator<Allocator>::get(a); }
-namespace container_detail {
+namespace dtl {
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
@@ -144,19 +144,19 @@ class scoped_allocator_adaptor_base
typedef allocator_traits<inner_allocator_type> inner_traits_type;
typedef scoped_allocator_adaptor
<OuterAlloc, InnerAllocs...> scoped_allocator_type;
- typedef container_detail::bool_<
+ typedef dtl::bool_<
outer_traits_type::propagate_on_container_copy_assignment::value ||
inner_allocator_type::propagate_on_container_copy_assignment::value
> propagate_on_container_copy_assignment;
- typedef container_detail::bool_<
+ typedef dtl::bool_<
outer_traits_type::propagate_on_container_move_assignment::value ||
inner_allocator_type::propagate_on_container_move_assignment::value
> propagate_on_container_move_assignment;
- typedef container_detail::bool_<
+ typedef dtl::bool_<
outer_traits_type::propagate_on_container_swap::value ||
inner_allocator_type::propagate_on_container_swap::value
> propagate_on_container_swap;
- typedef container_detail::bool_<
+ typedef dtl::bool_<
outer_traits_type::is_always_equal::value &&
inner_allocator_type::is_always_equal::value
> is_always_equal;
@@ -286,20 +286,20 @@ class scoped_allocator_adaptor_base<OuterAlloc, true, BOOST_MOVE_TARG##N>\
typedef scoped_allocator_adaptor<BOOST_MOVE_TARG##N> inner_allocator_type;\
typedef scoped_allocator_adaptor<OuterAlloc, BOOST_MOVE_TARG##N> scoped_allocator_type;\
typedef allocator_traits<inner_allocator_type> inner_traits_type;\
- typedef container_detail::bool_<\
+ typedef dtl::bool_<\
outer_traits_type::propagate_on_container_copy_assignment::value ||\
inner_allocator_type::propagate_on_container_copy_assignment::value\
> propagate_on_container_copy_assignment;\
- typedef container_detail::bool_<\
+ typedef dtl::bool_<\
outer_traits_type::propagate_on_container_move_assignment::value ||\
inner_allocator_type::propagate_on_container_move_assignment::value\
> propagate_on_container_move_assignment;\
- typedef container_detail::bool_<\
+ typedef dtl::bool_<\
outer_traits_type::propagate_on_container_swap::value ||\
inner_allocator_type::propagate_on_container_swap::value\
> propagate_on_container_swap;\
\
- typedef container_detail::bool_<\
+ typedef dtl::bool_<\
outer_traits_type::is_always_equal::value &&\
inner_allocator_type::is_always_equal::value\
> is_always_equal;\
@@ -521,7 +521,7 @@ class scoped_allocator_adaptor_base< OuterAlloc BOOST_CONTAINER_SCOPEDALLOC_DUMM
}
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -578,14 +578,14 @@ template <typename OuterAlloc, BOOST_MOVE_CLASS9>
class scoped_allocator_adaptor
#endif
- : public container_detail::scoped_allocator_adaptor_base
+ : public dtl::scoped_allocator_adaptor_base
<OuterAlloc BOOST_CONTAINER_SCOPEDALLOC_DUMMYTRUE, BOOST_CONTAINER_SCOPEDALLOC_ALLINNER>
{
BOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor)
public:
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef container_detail::scoped_allocator_adaptor_base
+ typedef dtl::scoped_allocator_adaptor_base
<OuterAlloc BOOST_CONTAINER_SCOPEDALLOC_DUMMYTRUE, BOOST_CONTAINER_SCOPEDALLOC_ALLINNER> base_type;
typedef typename base_type::internal_type_t internal_type_t;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -810,7 +810,7 @@ class scoped_allocator_adaptor
template < typename T, class ...Args>
void construct(T* p, BOOST_FWD_REF(Args)...args)
{
- container_detail::dispatch_uses_allocator
+ dtl::dispatch_uses_allocator
( (get_outermost_allocator)(this->outer_allocator())
, this->inner_allocator(), p, ::boost::forward<Args>(args)...);
}
@@ -823,7 +823,7 @@ class scoped_allocator_adaptor
template < typename T BOOST_MOVE_I##N BOOST_MOVE_CLASSQ##N >\
void construct(T* p BOOST_MOVE_I##N BOOST_MOVE_UREFQ##N)\
{\
- container_detail::dispatch_uses_allocator\
+ dtl::dispatch_uses_allocator\
( (get_outermost_allocator)(this->outer_allocator())\
, this->inner_allocator(), p BOOST_MOVE_I##N BOOST_MOVE_FWDQ##N);\
}\
@@ -888,7 +888,7 @@ inline bool operator==(const scoped_allocator_adaptor<OuterA1, BOOST_CONTAINER_S
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
const bool has_zero_inner = sizeof...(InnerAllocs) == 0u;
#else
- const bool has_zero_inner = boost::container::container_detail::is_same<P0, void>::value;
+ const bool has_zero_inner = boost::container::dtl::is_same<P0, void>::value;
#endif
typedef scoped_allocator_operator_equal<has_zero_inner> equal_t;
return equal_t::equal_outer(a.outer_allocator(), b.outer_allocator()) &&
diff --git a/boost/container/set.hpp b/boost/container/set.hpp
index 8730b1c89a..f6cde190de 100644
--- a/boost/container/set.hpp
+++ b/boost/container/set.hpp
@@ -60,21 +60,21 @@ namespace container {
//! \tparam Compare is the comparison functor used to order keys
//! \tparam Allocator is the allocator to be used to allocate memory for this container
//! \tparam Options is an packed option type generated using using boost::container::tree_assoc_options.
-template <class Key, class Compare = std::less<Key>, class Allocator = new_allocator<Key>, class Options = tree_assoc_defaults >
+template <class Key, class Compare = std::less<Key>, class Allocator = new_allocator<Key>, class Options = void>
#else
template <class Key, class Compare, class Allocator, class Options>
#endif
class set
///@cond
- : public container_detail::tree
- < Key, container_detail::identity<Key>, Compare, Allocator, Options>
+ : public dtl::tree
+ < Key, dtl::identity<Key>, Compare, Allocator, Options>
///@endcond
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(set)
- typedef container_detail::tree
- < Key, container_detail::identity<Key>, Compare, Allocator, Options> base_t;
+ typedef dtl::tree
+ < Key, dtl::identity<Key>, Compare, Allocator, Options> base_t;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -114,8 +114,8 @@ class set
//! <b>Complexity</b>: Constant.
BOOST_CONTAINER_FORCEINLINE set()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: base_t()
{}
@@ -320,7 +320,7 @@ class set
//!
//! <b>Postcondition</b>: x is emptied.
BOOST_CONTAINER_FORCEINLINE set(BOOST_RV_REF(set) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: base_t(BOOST_MOVE_BASE(base_t, x))
{}
@@ -356,7 +356,7 @@ class set
BOOST_CONTAINER_FORCEINLINE set& operator=(BOOST_RV_REF(set) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<set&>(this->base_t::operator=(BOOST_MOVE_BASE(base_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -639,8 +639,8 @@ class set
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(set<Key, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
- <Key, container_detail::identity<Key>, C2, Allocator, Options> base2_t;
+ typedef dtl::tree
+ <Key, dtl::identity<Key>, C2, Allocator, Options> base2_t;
this->base_t::merge_unique(static_cast<base2_t&>(source));
}
@@ -653,8 +653,8 @@ class set
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(multiset<Key, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
- <Key, container_detail::identity<Key>, C2, Allocator, Options> base2_t;
+ typedef dtl::tree
+ <Key, dtl::identity<Key>, C2, Allocator, Options> base2_t;
this->base_t::merge_unique(static_cast<base2_t&>(source));
}
@@ -701,7 +701,7 @@ class set
//! <b>Complexity</b>: Constant.
void swap(set& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value );
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value );
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
@@ -893,15 +893,15 @@ template <class Key, class Compare, class Allocator, class Options>
#endif
class multiset
/// @cond
- : public container_detail::tree
- <Key,container_detail::identity<Key>, Compare, Allocator, Options>
+ : public dtl::tree
+ <Key,dtl::identity<Key>, Compare, Allocator, Options>
/// @endcond
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(multiset)
- typedef container_detail::tree
- <Key,container_detail::identity<Key>, Compare, Allocator, Options> base_t;
+ typedef dtl::tree
+ <Key,dtl::identity<Key>, Compare, Allocator, Options> base_t;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -938,8 +938,8 @@ class multiset
//! @copydoc ::boost::container::set::set()
BOOST_CONTAINER_FORCEINLINE multiset()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value &&
- container_detail::is_nothrow_default_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value &&
+ dtl::is_nothrow_default_constructible<Compare>::value)
: base_t()
{}
@@ -1068,7 +1068,7 @@ class multiset
//! @copydoc ::boost::container::set::set(set &&)
BOOST_CONTAINER_FORCEINLINE multiset(BOOST_RV_REF(multiset) x)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<Compare>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<Compare>::value)
: base_t(BOOST_MOVE_BASE(base_t, x))
{}
@@ -1090,7 +1090,7 @@ class multiset
BOOST_CONTAINER_FORCEINLINE multiset& operator=(BOOST_RV_REF(multiset) x)
BOOST_NOEXCEPT_IF( (allocator_traits_type::propagate_on_container_move_assignment::value ||
allocator_traits_type::is_always_equal::value) &&
- boost::container::container_detail::is_nothrow_move_assignable<Compare>::value)
+ boost::container::dtl::is_nothrow_move_assignable<Compare>::value)
{ return static_cast<multiset&>(this->base_t::operator=(BOOST_MOVE_BASE(base_t, x))); }
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
@@ -1269,8 +1269,8 @@ class multiset
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(multiset<Key, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
- <Key, container_detail::identity<Key>, C2, Allocator, Options> base2_t;
+ typedef dtl::tree
+ <Key, dtl::identity<Key>, C2, Allocator, Options> base2_t;
this->base_t::merge_equal(static_cast<base2_t&>(source));
}
@@ -1283,8 +1283,8 @@ class multiset
template<class C2>
BOOST_CONTAINER_FORCEINLINE void merge(set<Key, C2, Allocator, Options>& source)
{
- typedef container_detail::tree
- <Key, container_detail::identity<Key>, C2, Allocator, Options> base2_t;
+ typedef dtl::tree
+ <Key, dtl::identity<Key>, C2, Allocator, Options> base2_t;
this->base_t::merge_equal(static_cast<base2_t&>(source));
}
@@ -1313,7 +1313,7 @@ class multiset
//! @copydoc ::boost::container::set::swap
void swap(multiset& x)
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
- && boost::container::container_detail::is_nothrow_swappable<Compare>::value );
+ && boost::container::dtl::is_nothrow_swappable<Compare>::value );
//! @copydoc ::boost::container::set::clear
void clear() BOOST_NOEXCEPT_OR_NOTHROW;
diff --git a/boost/container/slist.hpp b/boost/container/slist.hpp
index 3a1d66bb6d..d721e4f71c 100644
--- a/boost/container/slist.hpp
+++ b/boost/container/slist.hpp
@@ -34,6 +34,7 @@
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/node_alloc_holder.hpp>
#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/value_functors.hpp>
// intrusive
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/slist.hpp>
@@ -61,13 +62,13 @@ namespace container {
template <class T, class Allocator>
class slist;
-namespace container_detail {
+namespace dtl {
template<class VoidPointer>
struct slist_hook
{
- typedef typename container_detail::bi::make_slist_base_hook
- <container_detail::bi::void_pointer<VoidPointer>, container_detail::bi::link_mode<container_detail::bi::normal_link> >::type type;
+ typedef typename dtl::bi::make_slist_base_hook
+ <dtl::bi::void_pointer<VoidPointer>, dtl::bi::link_mode<dtl::bi::normal_link> >::type type;
};
template <class T, class VoidPointer>
@@ -104,20 +105,20 @@ struct intrusive_slist_type
<typename allocator_traits_type::pointer>::template
rebind_pointer<void>::type
void_pointer;
- typedef typename container_detail::slist_node
+ typedef typename dtl::slist_node
<value_type, void_pointer> node_type;
- typedef typename container_detail::bi::make_slist
+ typedef typename dtl::bi::make_slist
<node_type
- ,container_detail::bi::base_hook<typename slist_hook<void_pointer>::type>
- ,container_detail::bi::constant_time_size<true>
- , container_detail::bi::size_type
+ ,dtl::bi::base_hook<typename slist_hook<void_pointer>::type>
+ ,dtl::bi::constant_time_size<true>
+ , dtl::bi::size_type
<typename allocator_traits_type::size_type>
>::type container_type;
typedef container_type type ;
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -162,26 +163,26 @@ template <class T, class Allocator = new_allocator<T> >
template <class T, class Allocator>
#endif
class slist
- : protected container_detail::node_alloc_holder
- <Allocator, typename container_detail::intrusive_slist_type<Allocator>::type>
+ : protected dtl::node_alloc_holder
+ <Allocator, typename dtl::intrusive_slist_type<Allocator>::type>
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
typedef typename
- container_detail::intrusive_slist_type<Allocator>::type Icont;
- typedef container_detail::node_alloc_holder<Allocator, Icont> AllocHolder;
+ dtl::intrusive_slist_type<Allocator>::type Icont;
+ typedef dtl::node_alloc_holder<Allocator, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
typedef typename AllocHolder::NodeAlloc NodeAlloc;
typedef typename AllocHolder::ValAlloc ValAlloc;
typedef typename AllocHolder::Node Node;
- typedef container_detail::allocator_destroyer<NodeAlloc> Destroyer;
+ typedef dtl::allocator_destroyer<NodeAlloc> Destroyer;
typedef typename AllocHolder::alloc_version alloc_version;
typedef boost::container::
allocator_traits<Allocator> allocator_traits_type;
typedef boost::container::equal_to_value<Allocator> equal_to_value_type;
BOOST_COPYABLE_AND_MOVABLE(slist)
- typedef container_detail::iterator_from_iiterator<typename Icont::iterator, false> iterator_impl;
- typedef container_detail::iterator_from_iiterator<typename Icont::iterator, true > const_iterator_impl;
+ typedef dtl::iterator_from_iiterator<typename Icont::iterator, false> iterator_impl;
+ typedef dtl::iterator_from_iiterator<typename Icont::iterator, true > const_iterator_impl;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -216,7 +217,7 @@ class slist
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
- slist() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ slist() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: AllocHolder()
{}
@@ -357,7 +358,7 @@ class slist
if (&x != this){
NodeAlloc &this_alloc = this->node_alloc();
const NodeAlloc &x_alloc = x.node_alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
@@ -442,7 +443,7 @@ class slist
template <class InpIt>
void assign(InpIt first, InpIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_convertible<InpIt, size_type>::type * = 0
+ , typename dtl::disable_if_convertible<InpIt, size_type>::type * = 0
#endif
)
{
@@ -846,10 +847,10 @@ class slist
template <class InpIt>
iterator insert_after(const_iterator prev_p, InpIt first, InpIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::enable_if_c
- < !container_detail::is_convertible<InpIt, size_type>::value
- && (container_detail::is_input_iterator<InpIt>::value
- || container_detail::is_same<alloc_version, version_1>::value
+ , typename dtl::enable_if_c
+ < !dtl::is_convertible<InpIt, size_type>::value
+ && (dtl::is_input_iterator<InpIt>::value
+ || dtl::is_same<alloc_version, version_1>::value
)
>::type * = 0
#endif
@@ -884,10 +885,10 @@ class slist
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class FwdIt>
iterator insert_after(const_iterator prev, FwdIt first, FwdIt last
- , typename container_detail::enable_if_c
- < !container_detail::is_convertible<FwdIt, size_type>::value
- && !(container_detail::is_input_iterator<FwdIt>::value
- || container_detail::is_same<alloc_version, version_1>::value
+ , typename dtl::enable_if_c
+ < !dtl::is_convertible<FwdIt, size_type>::value
+ && !(dtl::is_input_iterator<FwdIt>::value
+ || dtl::is_same<alloc_version, version_1>::value
)
>::type * = 0
)
@@ -1165,7 +1166,7 @@ class slist
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
- { this->unique(value_equal()); }
+ { this->unique(value_equal_t()); }
//! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
@@ -1195,7 +1196,7 @@ class slist
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
void merge(slist & x)
- { this->merge(x, value_less()); }
+ { this->merge(x, value_less_t()); }
//! <b>Requires</b>: The lists x and *this must be distinct.
//!
@@ -1261,7 +1262,7 @@ class slist
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
void sort()
- { this->sort(value_less()); }
+ { this->sort(value_less_t()); }
//! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
@@ -1470,7 +1471,7 @@ class slist
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, slist& x, const_iterator i) BOOST_NOEXCEPT_OR_NOTHROW
- { this->splice_after(this->previous(p), x, this->previous(i)); }
+ { this->splice_after(this->previous(p), x, x.previous(i)); }
//! <b>Requires</b>: p must point to an element contained
//! by this list. i must point to an element contained in list x.
@@ -1504,7 +1505,7 @@ class slist
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, slist& x, const_iterator first, const_iterator last) BOOST_NOEXCEPT_OR_NOTHROW
- { this->splice_after(this->previous(p), x, this->previous(first), this->previous(last)); }
+ { this->splice_after(this->previous(p), x, x.previous(first), x.previous(last)); }
//! <b>Requires</b>: p must point to an element contained
//! by this list. first and last must point to elements contained in list x.
@@ -1625,28 +1626,9 @@ class slist
};
//Functors for member algorithm defaults
- struct value_less
- {
- bool operator()(const value_type &a, const value_type &b) const
- { return a < b; }
- };
-
- struct value_equal
- {
- bool operator()(const value_type &a, const value_type &b) const
- { return a == b; }
- };
+ typedef value_less<value_type> value_less_t;
+ typedef value_equal<value_type> value_equal_t;
- struct value_equal_to_this
- {
- explicit value_equal_to_this(const value_type &ref)
- : m_ref(ref){}
-
- bool operator()(const value_type &val) const
- { return m_ref == val; }
-
- const value_type &m_ref;
- };
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
diff --git a/boost/container/small_vector.hpp b/boost/container/small_vector.hpp
index 804740cc72..70704d6b63 100644
--- a/boost/container/small_vector.hpp
+++ b/boost/container/small_vector.hpp
@@ -118,11 +118,11 @@ class small_vector_allocator
typedef typename allocator_traits<Allocator>::propagate_on_container_move_assignment propagate_on_container_move_assignment;
typedef typename allocator_traits<Allocator>::propagate_on_container_swap propagate_on_container_swap;
//! An integral constant with member `value == false`
- typedef BOOST_CONTAINER_IMPDEF(container_detail::bool_<false>) is_always_equal;
+ typedef BOOST_CONTAINER_IMPDEF(dtl::bool_<false>) is_always_equal;
//! An integral constant with member `value == true`
- typedef BOOST_CONTAINER_IMPDEF(container_detail::bool_<true>) is_partially_propagable;
+ typedef BOOST_CONTAINER_IMPDEF(dtl::bool_<true>) is_partially_propagable;
- BOOST_CONTAINER_DOCIGN(typedef container_detail::version_type<small_vector_allocator BOOST_CONTAINER_I 1> version;)
+ BOOST_CONTAINER_DOCIGN(typedef dtl::version_type<small_vector_allocator BOOST_CONTAINER_I 1> version;)
//!Obtains an small_vector_allocator that allocates
//!objects of type T2
@@ -282,7 +282,8 @@ class small_vector_allocator
pointer internal_storage() const
{
typedef typename Allocator::value_type value_type;
- typedef container_detail::vector_alloc_holder< small_vector_allocator<Allocator> > vector_alloc_holder_t;
+ typedef typename allocator_traits_type::size_type size_type;
+ typedef vector_alloc_holder< small_vector_allocator<Allocator>, size_type > vector_alloc_holder_t;
typedef vector<value_type, small_vector_allocator<Allocator> > vector_base;
typedef small_vector_base<value_type, Allocator> derived_type;
//
@@ -337,7 +338,7 @@ class small_vector_base
pointer internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
{
return boost::intrusive::pointer_traits<pointer>::pointer_to
- (*const_cast<T*>(static_cast<const T*>(static_cast<const void*>(&m_storage_start))));
+ (*const_cast<T*>(static_cast<const T*>(static_cast<const void*>(m_storage_start.data))));
}
typedef vector<T, small_vector_allocator<SecondaryAllocator> > base_type;
@@ -345,12 +346,11 @@ class small_vector_base
const base_type &as_base() const { return static_cast<const base_type&>(*this); }
public:
- typedef typename container_detail::aligned_storage
- <sizeof(T), container_detail::alignment_of<T>::value>::type storage_type;
+ typedef typename dtl::aligned_storage
+ <sizeof(T), dtl::alignment_of<T>::value>::type storage_type;
typedef small_vector_allocator<SecondaryAllocator> allocator_type;
protected:
- typedef typename base_type::initial_capacity_t initial_capacity_t;
BOOST_CONTAINER_FORCEINLINE explicit small_vector_base(initial_capacity_t, std::size_t initial_capacity)
: base_type(initial_capacity_t(), this->internal_storage(), initial_capacity)
@@ -419,7 +419,7 @@ struct small_vector_storage_calculator
{
typedef small_vector_base<T, Allocator> svh_type;
typedef vector<T, small_vector_allocator<Allocator> > svhb_type;
- static const std::size_t s_align = container_detail::alignment_of<Storage>::value;
+ static const std::size_t s_align = dtl::alignment_of<Storage>::value;
static const std::size_t s_size = sizeof(Storage);
static const std::size_t svh_sizeof = sizeof(svh_type);
static const std::size_t svhb_sizeof = sizeof(svhb_type);
@@ -481,7 +481,6 @@ class small_vector : public small_vector_base<T, Allocator>
BOOST_COPYABLE_AND_MOVABLE(small_vector)
- typedef typename base_type::initial_capacity_t initial_capacity_t;
typedef allocator_traits<typename base_type::allocator_type> allocator_traits_type;
public:
@@ -507,7 +506,7 @@ class small_vector : public small_vector_base<T, Allocator>
public:
BOOST_CONTAINER_FORCEINLINE small_vector()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: base_type(initial_capacity_t(), internal_capacity())
{}
@@ -541,18 +540,18 @@ class small_vector : public small_vector_base<T, Allocator>
template <class InIt>
BOOST_CONTAINER_FORCEINLINE small_vector(InIt first, InIt last
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c
- < container_detail::is_convertible<InIt BOOST_MOVE_I size_type>::value
- BOOST_MOVE_I container_detail::nat >::type * = 0)
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
+ < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
+ BOOST_MOVE_I dtl::nat >::type * = 0)
)
: base_type(initial_capacity_t(), internal_capacity())
{ this->assign(first, last); }
template <class InIt>
BOOST_CONTAINER_FORCEINLINE small_vector(InIt first, InIt last, const allocator_type& a
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c
- < container_detail::is_convertible<InIt BOOST_MOVE_I size_type>::value
- BOOST_MOVE_I container_detail::nat >::type * = 0)
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
+ < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
+ BOOST_MOVE_I dtl::nat >::type * = 0)
)
: base_type(initial_capacity_t(), internal_capacity(), a)
{ this->assign(first, last); }
diff --git a/boost/container/stable_vector.hpp b/boost/container/stable_vector.hpp
index cf156e04de..88518bcabf 100644
--- a/boost/container/stable_vector.hpp
+++ b/boost/container/stable_vector.hpp
@@ -245,7 +245,7 @@ class stable_vector_iterator
typedef std::random_access_iterator_tag iterator_category;
typedef typename non_const_ptr_traits::element_type value_type;
typedef typename non_const_ptr_traits::difference_type difference_type;
- typedef typename ::boost::container::container_detail::if_c
+ typedef typename ::boost::container::dtl::if_c
< IsConst
, typename non_const_ptr_traits::template
rebind_pointer<const value_type>::type
@@ -464,14 +464,14 @@ class stable_vector
typedef typename node_ptr_traits::reference node_reference;
typedef typename const_node_ptr_traits::reference const_node_reference;
- typedef ::boost::container::container_detail::integral_constant
- <unsigned, boost::container::container_detail::
+ typedef ::boost::container::dtl::integral_constant
+ <unsigned, boost::container::dtl::
version<Allocator>::value> alloc_version;
typedef typename allocator_traits_type::
template portable_rebind_alloc
<node_type>::type node_allocator_type;
- typedef ::boost::container::container_detail::
+ typedef ::boost::container::dtl::
allocator_version_traits<node_allocator_type> allocator_version_traits_t;
typedef typename allocator_version_traits_t::multiallocation_chain multiallocation_chain;
@@ -540,7 +540,7 @@ class stable_vector
//! <b>Throws</b>: If allocator_type's default constructor throws.
//!
//! <b>Complexity</b>: Constant.
- stable_vector() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ stable_vector() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: internal_data(), index()
{
STABLE_VECTOR_CHECK_INVARIANT;
@@ -765,14 +765,14 @@ class stable_vector
if (&x != this){
node_allocator_type &this_alloc = this->priv_node_alloc();
const node_allocator_type &x_alloc = x.priv_node_alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
this->shrink_to_fit();
}
- container_detail::assign_alloc(this->priv_node_alloc(), x.priv_node_alloc(), flag);
- container_detail::assign_alloc(this->index.get_stored_allocator(), x.index.get_stored_allocator(), flag);
+ dtl::assign_alloc(this->priv_node_alloc(), x.priv_node_alloc(), flag);
+ dtl::assign_alloc(this->index.get_stored_allocator(), x.index.get_stored_allocator(), flag);
this->assign(x.begin(), x.end());
}
return *this;
@@ -799,7 +799,7 @@ class stable_vector
node_allocator_type &x_alloc = x.priv_node_alloc();
const bool propagate_alloc = allocator_traits_type::
propagate_on_container_move_assignment::value;
- container_detail::bool_<propagate_alloc> flag;
+ dtl::bool_<propagate_alloc> flag;
const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal;
//Resources can be transferred if both allocators are
//going to be equal after this function (either propagated or already equal)
@@ -808,7 +808,7 @@ class stable_vector
//Destroy objects but retain memory in case x reuses it in the future
this->clear();
//Move allocator if needed
- container_detail::move_alloc(this_alloc, x_alloc, flag);
+ dtl::move_alloc(this_alloc, x_alloc, flag);
//Take resources
this->index.swap(x.index);
this->priv_swap_members(x);
@@ -852,7 +852,7 @@ class stable_vector
//! <b>Complexity</b>: Linear to n.
template<typename InputIterator>
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- typename container_detail::disable_if_convertible<InputIterator, size_type>::type
+ typename dtl::disable_if_convertible<InputIterator, size_type>::type
#else
void
#endif
@@ -1537,10 +1537,10 @@ class stable_vector
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//Put this as argument instead of the return type as old GCC's like 3.4
//detect this and the next disable_if_or as overloads
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InputIterator, size_type>
- , container_detail::is_not_input_iterator<InputIterator>
+ , dtl::is_convertible<InputIterator, size_type>
+ , dtl::is_not_input_iterator<InputIterator>
>::type* = 0
#endif
)
@@ -1556,10 +1556,10 @@ class stable_vector
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class FwdIt>
- typename container_detail::disable_if_or
+ typename dtl::disable_if_or
< iterator
- , container_detail::is_convertible<FwdIt, size_type>
- , container_detail::is_input_iterator<FwdIt>
+ , dtl::is_convertible<FwdIt, size_type>
+ , dtl::is_input_iterator<FwdIt>
>::type
insert(const_iterator p, FwdIt first, FwdIt last)
{
@@ -1672,8 +1672,8 @@ class stable_vector
allocator_traits_type::is_always_equal::value ||
this->get_stored_allocator() == x.get_stored_allocator());
STABLE_VECTOR_CHECK_INVARIANT;
- container_detail::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
- container_detail::swap_alloc(this->priv_node_alloc(), x.priv_node_alloc(), flag);
+ dtl::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
+ dtl::swap_alloc(this->priv_node_alloc(), x.priv_node_alloc(), flag);
//vector's allocator is swapped here
this->index.swap(x.index);
this->priv_swap_members(x);
@@ -1956,7 +1956,7 @@ class stable_vector
void priv_destroy_node(const node_type &n)
{
allocator_traits<node_allocator_type>::
- destroy(this->priv_node_alloc(), container_detail::addressof(n.value));
+ destroy(this->priv_node_alloc(), dtl::addressof(n.value));
static_cast<const node_base_type*>(&n)->~node_base_type();
}
@@ -1972,7 +1972,7 @@ class stable_vector
//This can throw
boost::container::construct_in_place
( this->priv_node_alloc()
- , container_detail::addressof(p->value)
+ , dtl::addressof(p->value)
, it);
//This does not throw
::new(static_cast<node_base_type*>(boost::movelib::to_raw_pointer(p)), boost_container_new_t())
@@ -1985,7 +1985,7 @@ class stable_vector
//This can throw
boost::container::allocator_traits<node_allocator_type>::construct
( this->priv_node_alloc()
- , container_detail::addressof(p->value)
+ , dtl::addressof(p->value)
, ::boost::forward<ValueConvertible>(value_convertible));
//This does not throw
::new(static_cast<node_base_type*>(boost::movelib::to_raw_pointer(p)), boost_container_new_t()) node_base_type;
diff --git a/boost/container/static_vector.hpp b/boost/container/static_vector.hpp
index 4a341c383c..b40d5c37f6 100644
--- a/boost/container/static_vector.hpp
+++ b/boost/container/static_vector.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace container {
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
+namespace dtl {
template<class T, std::size_t N>
class static_storage_allocator
@@ -51,17 +51,17 @@ class static_storage_allocator
{ return *this; }
BOOST_CONTAINER_FORCEINLINE T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
- { return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(&storage))); }
+ { return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(storage.data))); }
BOOST_CONTAINER_FORCEINLINE T* internal_storage() BOOST_NOEXCEPT_OR_NOTHROW
- { return static_cast<T*>(static_cast<void*>(&storage)); }
+ { return static_cast<T*>(static_cast<void*>(storage.data)); }
static const std::size_t internal_capacity = N;
std::size_t max_size() const
{ return N; }
- typedef boost::container::container_detail::version_type<static_storage_allocator, 0> version;
+ typedef boost::container::dtl::version_type<static_storage_allocator, 0> version;
BOOST_CONTAINER_FORCEINLINE friend bool operator==(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return false; }
@@ -73,7 +73,7 @@ class static_storage_allocator
typename aligned_storage<sizeof(T)*N, alignment_of<T>::value>::type storage;
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -103,10 +103,10 @@ class static_storage_allocator
//!@tparam Capacity The maximum number of elements static_vector can store, fixed at compile time.
template <typename Value, std::size_t Capacity>
class static_vector
- : public vector<Value, container_detail::static_storage_allocator<Value, Capacity> >
+ : public vector<Value, dtl::static_storage_allocator<Value, Capacity> >
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- typedef vector<Value, container_detail::static_storage_allocator<Value, Capacity> > base_t;
+ typedef vector<Value, dtl::static_storage_allocator<Value, Capacity> > base_t;
BOOST_COPYABLE_AND_MOVABLE(static_vector)
@@ -114,7 +114,7 @@ class static_vector
friend class static_vector;
public:
- typedef container_detail::static_storage_allocator<Value, Capacity> allocator_type;
+ typedef dtl::static_storage_allocator<Value, Capacity> allocator_type;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -259,7 +259,7 @@ public:
{}
BOOST_CONTAINER_FORCEINLINE static_vector(BOOST_RV_REF(static_vector) other, const allocator_type &)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<value_type>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<value_type>::value)
: base_t(BOOST_MOVE_BASE(base_t, other))
{}
@@ -294,7 +294,7 @@ public:
//! @par Complexity
//! Linear O(N).
BOOST_CONTAINER_FORCEINLINE static_vector(BOOST_RV_REF(static_vector) other)
- BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<value_type>::value)
+ BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_constructible<value_type>::value)
: base_t(BOOST_MOVE_BASE(base_t, other))
{}
@@ -1228,7 +1228,7 @@ inline void swap(static_vector<V, C1> & x, static_vector<V, C2> & y);
template<typename V, std::size_t C1, std::size_t C2>
inline void swap(static_vector<V, C1> & x, static_vector<V, C2> & y
- , typename container_detail::enable_if_c< C1 != C2>::type * = 0)
+ , typename dtl::enable_if_c< C1 != C2>::type * = 0)
{
x.swap(y);
}
diff --git a/boost/container/string.hpp b/boost/container/string.hpp
index cba6325f80..8829fdaadb 100644
--- a/boost/container/string.hpp
+++ b/boost/container/string.hpp
@@ -70,7 +70,7 @@ namespace boost {
namespace container {
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
+namespace dtl {
// ------------------------------------------------------------
// Class basic_string_base.
@@ -170,8 +170,8 @@ class basic_string_base
//This type has the same alignment and size as long_t but it's POD
//so, unlike long_t, it can be placed in a union
- typedef typename container_detail::aligned_storage
- <sizeof(long_t), container_detail::alignment_of<long_t>::value>::type long_raw_t;
+ typedef typename dtl::aligned_storage
+ <sizeof(long_t), dtl::alignment_of<long_t>::value>::type long_raw_t;
protected:
static const size_type MinInternalBufferChars = 8;
@@ -199,7 +199,7 @@ class basic_string_base
{ return s; }
const long_t &long_repr() const
- { return *static_cast<const long_t*>(static_cast<const void*>(&r)); }
+ { return *static_cast<const long_t*>(static_cast<const void*>(r.data)); }
short_t &short_repr()
{ return s; }
@@ -274,8 +274,8 @@ class basic_string_base
protected:
- typedef container_detail::integral_constant<unsigned,
- boost::container::container_detail::version<Allocator>::value> alloc_version;
+ typedef dtl::integral_constant<unsigned,
+ boost::container::dtl::version<Allocator>::value> alloc_version;
pointer allocation_command(allocation_type command,
size_type limit_size,
@@ -286,16 +286,14 @@ class basic_string_base
reuse = 0;
command &= ~(expand_fwd | expand_bwd);
}
- return container_detail::allocator_version_traits<Allocator>::allocation_command
+ return dtl::allocator_version_traits<Allocator>::allocation_command
(this->alloc(), command, limit_size, prefer_in_recvd_out_size, reuse);
}
size_type next_capacity(size_type additional_objects) const
{
- return next_capacity_calculator
- <size_type, NextCapacityDouble /*NextCapacity60Percent*/>::
- get( allocator_traits_type::max_size(this->alloc())
- , this->priv_storage(), additional_objects );
+ return growth_factor_100()
+ ( this->priv_storage(), additional_objects, allocator_traits_type::max_size(this->alloc()));
}
void deallocate(pointer p, size_type n)
@@ -460,7 +458,7 @@ class basic_string_base
}
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -502,13 +500,13 @@ template <class CharT, class Traits = std::char_traits<CharT>, class Allocator =
template <class CharT, class Traits, class Allocator>
#endif
class basic_string
- : private container_detail::basic_string_base<Allocator>
+ : private dtl::basic_string_base<Allocator>
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
typedef allocator_traits<Allocator> allocator_traits_type;
BOOST_COPYABLE_AND_MOVABLE(basic_string)
- typedef container_detail::basic_string_base<Allocator> base_t;
+ typedef dtl::basic_string_base<Allocator> base_t;
static const typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars;
protected:
@@ -598,7 +596,7 @@ class basic_string
//! <b>Effects</b>: Default constructs a basic_string.
//!
//! <b>Throws</b>: If allocator_type's default constructor throws.
- basic_string() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ basic_string() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: base_t()
{ this->priv_terminate_string(); }
@@ -689,7 +687,7 @@ class basic_string
throw_out_of_range("basic_string::basic_string out of range position");
else
this->assign
- (s.begin() + pos, s.begin() + pos + container_detail::min_value(n, s.size() - pos));
+ (s.begin() + pos, s.begin() + pos + dtl::min_value(n, s.size() - pos));
}
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
@@ -702,7 +700,7 @@ class basic_string
throw_out_of_range("basic_string::basic_string out of range position");
else
this->assign
- (s.begin() + pos, s.begin() + pos + container_detail::min_value(n, s.size() - pos));
+ (s.begin() + pos, s.begin() + pos + dtl::min_value(n, s.size() - pos));
}
//! <b>Effects</b>: Constructs a basic_string taking a default-constructed allocator,
@@ -827,7 +825,7 @@ class basic_string
if (&x != this){
allocator_type &this_alloc = this->alloc();
const allocator_type &x_alloc = x.alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
if(!this->is_short()){
@@ -837,7 +835,7 @@ class basic_string
this->priv_short_size(0);
}
}
- container_detail::assign_alloc(this->alloc(), x.alloc(), flag);
+ dtl::assign_alloc(this->alloc(), x.alloc(), flag);
this->assign(x.begin(), x.end());
}
return *this;
@@ -861,7 +859,7 @@ class basic_string
allocator_type &x_alloc = x.alloc();
const bool propagate_alloc = allocator_traits_type::
propagate_on_container_move_assignment::value;
- container_detail::bool_<propagate_alloc> flag;
+ dtl::bool_<propagate_alloc> flag;
const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal;
//Resources can be transferred if both allocators are
//going to be equal after this function (either propagated or already equal)
@@ -869,7 +867,7 @@ class basic_string
//Destroy objects but retain memory in case x reuses it in the future
this->clear();
//Move allocator if needed
- container_detail::move_alloc(this_alloc, x_alloc, flag);
+ dtl::move_alloc(this_alloc, x_alloc, flag);
//Nothrow swap
this->swap_data(x);
}
@@ -1356,7 +1354,7 @@ class basic_string
if (pos > s.size())
throw_out_of_range("basic_string::append out of range position");
return this->append(s.begin() + pos,
- s.begin() + pos + container_detail::min_value(n, s.size() - pos));
+ s.begin() + pos + dtl::min_value(n, s.size() - pos));
}
//! <b>Requires</b>: s points to an array of at least n elements of CharT.
@@ -1457,7 +1455,7 @@ class basic_string
if (pos > s.size())
throw_out_of_range("basic_string::assign out of range position");
return this->assign(s.begin() + pos,
- s.begin() + pos + container_detail::min_value(n, s.size() - pos));
+ s.begin() + pos + dtl::min_value(n, s.size() - pos));
}
//! <b>Requires</b>: s points to an array of at least n elements of CharT.
@@ -1505,7 +1503,7 @@ class basic_string
template <class InputIter>
basic_string& assign(InputIter first, InputIter last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_convertible<InputIter, size_type>::type * = 0
+ , typename dtl::disable_if_convertible<InputIter, size_type>::type * = 0
#endif
)
{
@@ -1567,7 +1565,7 @@ class basic_string
const size_type str_size = s.size();
if (pos1 > sz || pos2 > str_size)
throw_out_of_range("basic_string::insert out of range position");
- size_type len = container_detail::min_value(n, str_size - pos2);
+ size_type len = dtl::min_value(n, str_size - pos2);
if (sz > this->max_size() - len)
throw_length_error("basic_string::insert max_size() exceeded");
const CharT *beg_ptr = boost::movelib::to_raw_pointer(s.begin()) + pos2;
@@ -1666,10 +1664,10 @@ class basic_string
template <class InputIter>
iterator insert(const_iterator p, InputIter first, InputIter last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InputIter, size_type>
- , container_detail::is_not_input_iterator<InputIter>
+ , dtl::is_convertible<InputIter, size_type>
+ , dtl::is_not_input_iterator<InputIter>
>::type * = 0
#endif
)
@@ -1684,10 +1682,10 @@ class basic_string
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class ForwardIter>
iterator insert(const_iterator p, ForwardIter first, ForwardIter last
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<ForwardIter, size_type>
- , container_detail::is_input_iterator<ForwardIter>
+ , dtl::is_convertible<ForwardIter, size_type>
+ , dtl::is_input_iterator<ForwardIter>
>::type * = 0
)
{
@@ -1834,7 +1832,7 @@ class basic_string
if (pos > this->size())
throw_out_of_range("basic_string::erase out of range position");
const pointer addr = this->priv_addr();
- erase(addr + pos, addr + pos + container_detail::min_value(n, this->size() - pos));
+ erase(addr + pos, addr + pos + dtl::min_value(n, this->size() - pos));
return *this;
}
@@ -1903,7 +1901,7 @@ class basic_string
{
if (pos1 > this->size())
throw_out_of_range("basic_string::replace out of range position");
- const size_type len = container_detail::min_value(n1, this->size() - pos1);
+ const size_type len = dtl::min_value(n1, this->size() - pos1);
if (this->size() - len >= this->max_size() - str.size())
throw_length_error("basic_string::replace max_size() exceeded");
const pointer addr = this->priv_addr();
@@ -1934,7 +1932,7 @@ class basic_string
{
if (pos2 > str.size())
throw_out_of_range("basic_string::replace out of range position");
- return this->replace(pos1, n1, str.data()+pos2, container_detail::min_value(n2, str.size() - pos2));
+ return this->replace(pos1, n1, str.data()+pos2, dtl::min_value(n2, str.size() - pos2));
}
//! <b>Throws</b>: out_of_range if pos1 > size() or pos2 > sv.size().
@@ -1949,7 +1947,7 @@ class basic_string
{
if (pos2 > sv.size())
throw_out_of_range("basic_string::replace out of range position");
- return this->replace(pos1, n1, sv.data()+pos2, container_detail::min_value(n2, sv.size() - pos2));
+ return this->replace(pos1, n1, sv.data()+pos2, dtl::min_value(n2, sv.size() - pos2));
}
//! <b>Requires</b>: pos1 <= size() and s points to an array of at least n2 elements of CharT.
@@ -1970,7 +1968,7 @@ class basic_string
{
if (pos1 > this->size())
throw_out_of_range("basic_string::replace out of range position");
- const size_type len = container_detail::min_value(n1, this->size() - pos1);
+ const size_type len = dtl::min_value(n1, this->size() - pos1);
const size_type max_size = this->max_size();
if (n2 > max_size || (this->size() - len) >= (max_size - n2))
throw_length_error("basic_string::replace max_size() exceeded");
@@ -2009,7 +2007,7 @@ class basic_string
{
if (pos1 > this->size())
throw_out_of_range("basic_string::replace out of range position");
- const size_type len = container_detail::min_value(n1, this->size() - pos1);
+ const size_type len = dtl::min_value(n1, this->size() - pos1);
if (n2 > this->max_size() || this->size() - len >= this->max_size() - n2)
throw_length_error("basic_string::replace max_size() exceeded");
const pointer addr = this->priv_addr();
@@ -2079,10 +2077,10 @@ class basic_string
template <class InputIter>
basic_string& replace(const_iterator i1, const_iterator i2, InputIter j1, InputIter j2
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InputIter, size_type>
- , container_detail::is_input_iterator<InputIter>
+ , dtl::is_convertible<InputIter, size_type>
+ , dtl::is_input_iterator<InputIter>
>::type * = 0
#endif
)
@@ -2101,10 +2099,10 @@ class basic_string
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class ForwardIter>
basic_string& replace(const_iterator i1, const_iterator i2, ForwardIter j1, ForwardIter j2
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<ForwardIter, size_type>
- , container_detail::is_not_input_iterator<ForwardIter>
+ , dtl::is_convertible<ForwardIter, size_type>
+ , dtl::is_not_input_iterator<ForwardIter>
>::type * = 0
)
{
@@ -2165,7 +2163,7 @@ class basic_string
{
if (pos > this->size())
throw_out_of_range("basic_string::copy out of range position");
- const size_type len = container_detail::min_value(n, this->size() - pos);
+ const size_type len = dtl::min_value(n, this->size() - pos);
Traits::copy(s, boost::movelib::to_raw_pointer(this->priv_addr() + pos), len);
return len;
}
@@ -2179,8 +2177,8 @@ class basic_string
|| allocator_traits_type::is_always_equal::value)
{
this->base_t::swap_data(x);
- container_detail::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
- container_detail::swap_alloc(this->alloc(), x.alloc(), flag);
+ dtl::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
+ dtl::swap_alloc(this->alloc(), x.alloc(), flag);
}
//////////////////////////////////////////////
@@ -2340,9 +2338,9 @@ class basic_string
if (n > len)
return npos;
else if (n == 0)
- return container_detail::min_value(len, pos);
+ return dtl::min_value(len, pos);
else {
- const const_iterator last = begin() + container_detail::min_value(len - n, pos) + n;
+ const const_iterator last = begin() + dtl::min_value(len - n, pos) + n;
const const_iterator result = find_end(begin(), last,
s, s + n,
Eq_traits<Traits>());
@@ -2369,7 +2367,7 @@ class basic_string
if (len < 1)
return npos;
else {
- const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1;
+ const const_iterator last = begin() + dtl::min_value(len - 1, pos) + 1;
const_reverse_iterator rresult =
boost::container::find_if(const_reverse_iterator(last), rend(),
boost::container::bind2nd(Eq_traits<Traits>(), c));
@@ -2467,7 +2465,7 @@ class basic_string
return npos;
else {
const pointer addr = this->priv_addr();
- const const_iterator last = addr + container_detail::min_value(len - 1, pos) + 1;
+ const const_iterator last = addr + dtl::min_value(len - 1, pos) + 1;
const const_reverse_iterator rresult =
boost::container::find_first_of(const_reverse_iterator(last), rend(),
s, s + n, Eq_traits<Traits>());
@@ -2588,7 +2586,7 @@ class basic_string
if (len < 1)
return npos;
else {
- const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1;
+ const const_iterator last = begin() + dtl::min_value(len - 1, pos) + 1;
const const_reverse_iterator rresult =
boost::container::find_if(const_reverse_iterator(last), rend(),
Not_within_traits<Traits>(s, s + n));
@@ -2614,7 +2612,7 @@ class basic_string
if (len < 1)
return npos;
else {
- const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1;
+ const const_iterator last = begin() + dtl::min_value(len - 1, pos) + 1;
const const_reverse_iterator rresult =
boost::container::find_if(const_reverse_iterator(last), rend(),
boost::container::not1(boost::container::bind2nd(Eq_traits<Traits>(), c)));
@@ -2636,7 +2634,7 @@ class basic_string
throw_out_of_range("basic_string::substr out of range position");
const pointer addr = this->priv_addr();
return basic_string(addr + pos,
- addr + pos + container_detail::min_value(n, size() - pos), this->alloc());
+ addr + pos + dtl::min_value(n, size() - pos), this->alloc());
}
//! <b>Effects</b>: Determines the effective length rlen of the string to compare as
@@ -2681,7 +2679,7 @@ class basic_string
const pointer addr = this->priv_addr();
const pointer str_addr = str.priv_addr();
return s_compare(addr + pos1,
- addr + pos1 + container_detail::min_value(n1, this->size() - pos1),
+ addr + pos1 + dtl::min_value(n1, this->size() - pos1),
str_addr, str_addr + str.priv_size());
}
@@ -2697,7 +2695,7 @@ class basic_string
throw_out_of_range("basic_string::compare out of range position");
const pointer addr = this->priv_addr() + pos1;
const CharT* str_addr = sv.data();
- return s_compare(addr, addr + container_detail::min_value(n1, this->size() - pos1),
+ return s_compare(addr, addr + dtl::min_value(n1, this->size() - pos1),
str_addr, str_addr + sv.size());
}
@@ -2715,8 +2713,8 @@ class basic_string
throw_out_of_range("basic_string::compare out of range position");
const pointer addr = this->priv_addr() + pos1;
const pointer str_addr = str.priv_addr() + pos2;
- return s_compare(addr, addr + container_detail::min_value(n1, this->size() - pos1),
- str_addr, str_addr + container_detail::min_value(n2, str.size() - pos2));
+ return s_compare(addr, addr + dtl::min_value(n1, this->size() - pos1),
+ str_addr, str_addr + dtl::min_value(n2, str.size() - pos2));
}
//! <b>Requires</b>: pos1 <= size() and pos2 <= str.size()
@@ -2734,8 +2732,8 @@ class basic_string
throw_out_of_range("basic_string::compare out of range position");
const pointer addr = this->priv_addr() + pos1;
const CharT * str_addr = sv.data() + pos2;
- return s_compare(addr, addr + container_detail::min_value(n1, this->size() - pos1),
- str_addr, str_addr + container_detail::min_value(n2, sv.size() - pos2));
+ return s_compare(addr, addr + dtl::min_value(n1, this->size() - pos1),
+ str_addr, str_addr + dtl::min_value(n2, sv.size() - pos2));
}
//! <b>Throws</b>: Nothing
@@ -2758,7 +2756,7 @@ class basic_string
throw_out_of_range("basic_string::compare out of range position");
const pointer addr = this->priv_addr();
return s_compare( addr + pos1,
- addr + pos1 + container_detail::min_value(n1, this->size() - pos1),
+ addr + pos1 + dtl::min_value(n1, this->size() - pos1),
s, s + n2);
}
@@ -2779,7 +2777,7 @@ class basic_string
}
if (this->capacity() < res_arg){
- size_type n = container_detail::max_value(res_arg, this->size()) + 1;
+ size_type n = dtl::max_value(res_arg, this->size()) + 1;
size_type new_cap = this->next_capacity(n);
pointer reuse = 0;
pointer new_start = this->allocation_command(allocate_new, n, new_cap, reuse);
@@ -2806,14 +2804,14 @@ class basic_string
const difference_type n2 = l2 - f2;
const int cmp = Traits::compare(boost::movelib::to_raw_pointer(f1),
boost::movelib::to_raw_pointer(f2),
- container_detail::min_value(n1, n2));
+ dtl::min_value(n1, n2));
return cmp != 0 ? cmp : (n1 < n2 ? -1 : (n1 > n2 ? 1 : 0));
}
template<class AllocVersion>
void priv_shrink_to_fit_dynamic_buffer
( AllocVersion
- , typename container_detail::enable_if<container_detail::is_same<AllocVersion, version_1> >::type* = 0)
+ , typename dtl::enable_if<dtl::is_same<AllocVersion, version_1> >::type* = 0)
{
//Allocate a new buffer.
size_type real_cap = 0;
@@ -2843,7 +2841,7 @@ class basic_string
template<class AllocVersion>
void priv_shrink_to_fit_dynamic_buffer
( AllocVersion
- , typename container_detail::enable_if<container_detail::is_same<AllocVersion, version_2> >::type* = 0)
+ , typename dtl::enable_if<dtl::is_same<AllocVersion, version_2> >::type* = 0)
{
size_type received_size = this->priv_long_size()+1;
pointer hint = this->priv_long_addr();
@@ -2920,13 +2918,13 @@ class basic_string
template <class Integer>
basic_string& priv_replace_dispatch(const_iterator first, const_iterator last,
Integer n, Integer x,
- container_detail::true_)
+ dtl::true_)
{ return this->replace(first, last, (size_type) n, (CharT) x); }
template <class InputIter>
basic_string& priv_replace_dispatch(const_iterator first, const_iterator last,
InputIter f, InputIter l,
- container_detail::false_)
+ dtl::false_)
{
typedef typename boost::container::iterator_traits<InputIter>::iterator_category Category;
return this->priv_replace(first, last, f, l, Category());
@@ -3080,7 +3078,7 @@ operator==(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator==( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{
@@ -3091,7 +3089,7 @@ inline
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator==( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{
@@ -3118,7 +3116,7 @@ operator!=(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator!=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{ return !(x == y); }
@@ -3126,7 +3124,7 @@ operator!=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,All
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator!=( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{ return !(x == y); }
@@ -3156,7 +3154,7 @@ operator<(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator<( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{ return y.compare(x) > 0; }
@@ -3164,7 +3162,7 @@ operator<( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allo
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator<( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{ return x.compare(y) < 0; }
@@ -3191,7 +3189,7 @@ operator>(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator>( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{ return y < x; }
@@ -3199,7 +3197,7 @@ operator>( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allo
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator>( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{ return y < x; }
@@ -3225,7 +3223,7 @@ operator<=(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator<=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{ return !(y < x); }
@@ -3233,7 +3231,7 @@ operator<=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,All
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator<=( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{ return !(y < x); }
@@ -3257,7 +3255,7 @@ operator>=(const basic_string<CharT,Traits,Allocator>& x, const CharT* s)
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator>=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,Allocator>& y)
{ return !(x < y); }
@@ -3265,7 +3263,7 @@ operator>=( BasicStringView<CharT,Traits> x, const basic_string<CharT,Traits,All
template <class CharT, class Traits, class Allocator, template <class, class> class BasicStringView>
inline
BOOST_CONTAINER_DOC1ST( bool,
- typename container_detail::disable_if
+ typename dtl::disable_if
<is_string< BasicStringView<CharT BOOST_MOVE_I Traits> > BOOST_MOVE_I bool >::type)
operator>=( const basic_string<CharT,Traits,Allocator>& x, BasicStringView<CharT,Traits> y)
{ return !(x < y); }
@@ -3277,7 +3275,7 @@ inline void swap(basic_string<CharT,Traits,Allocator>& x, basic_string<CharT,Tra
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
// I/O.
-namespace container_detail {
+namespace dtl {
template <class CharT, class Traits>
inline bool
@@ -3294,7 +3292,7 @@ string_fill(std::basic_ostream<CharT, Traits>& os,
return ok;
}
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class CharT, class Traits, class Allocator>
@@ -3316,13 +3314,13 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const basic_string<CharT,Trait
pad_len = w - n;
if (!left)
- ok = container_detail::string_fill(os, buf, pad_len);
+ ok = dtl::string_fill(os, buf, pad_len);
ok = ok &&
buf->sputn(s.data(), std::streamsize(n)) == std::streamsize(n);
if (left)
- ok = ok && container_detail::string_fill(os, buf, pad_len);
+ ok = ok && dtl::string_fill(os, buf, pad_len);
}
if (!ok)
diff --git a/boost/container/uses_allocator.hpp b/boost/container/uses_allocator.hpp
index 2bcc465890..e0e3518081 100644
--- a/boost/container/uses_allocator.hpp
+++ b/boost/container/uses_allocator.hpp
@@ -112,7 +112,7 @@ struct constructible_with_allocator_prefix
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
+namespace dtl {
template<typename T, typename Allocator>
struct uses_allocator_imp
@@ -130,8 +130,8 @@ struct uses_allocator_imp
// Match this function if T::allocator_type exists and it's type is `erased_type`.
template <class U, class V>
- static typename container_detail::enable_if
- < container_detail::is_same<typename U::allocator_type, erased_type>
+ static typename dtl::enable_if
+ < dtl::is_same<typename U::allocator_type, erased_type>
, yes_type
>::type test(const V&);
@@ -145,7 +145,7 @@ struct uses_allocator_imp
static const bool value = sizeof(test<T>(alloc)) == sizeof(yes_type);
};
-} //namespace container_detail {
+} //namespace dtl {
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -161,7 +161,7 @@ struct uses_allocator_imp
//! is an alias `erased_type`. False otherwise.
template <typename T, typename Allocator>
struct uses_allocator
- : container_detail::uses_allocator_imp<T, Allocator>
+ : dtl::uses_allocator_imp<T, Allocator>
{};
}} //namespace boost::container
diff --git a/boost/container/vector.hpp b/boost/container/vector.hpp
index 8e1e7a53a3..89ed12e99f 100644
--- a/boost/container/vector.hpp
+++ b/boost/container/vector.hpp
@@ -27,6 +27,7 @@
#include <boost/container/allocator_traits.hpp>
#include <boost/container/new_allocator.hpp> //new_allocator
#include <boost/container/throw_exception.hpp>
+#include <boost/container/options.hpp>
// container detail
#include <boost/container/detail/advanced_insert_int.hpp>
#include <boost/container/detail/algorithm.hpp> //equal()
@@ -39,6 +40,7 @@
#include <boost/move/detail/iterator_to_raw_pointer.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/next_capacity.hpp>
+#include <boost/container/detail/value_functors.hpp>
#include <boost/move/detail/to_raw_pointer.hpp>
#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/version_type.hpp>
@@ -58,6 +60,7 @@
#include <boost/move/algo/adaptive_merge.hpp>
#include <boost/move/algo/unique.hpp>
#include <boost/move/algo/predicate.hpp>
+#include <boost/move/algo/detail/set_difference.hpp>
// other
#include <boost/core/no_exceptions_support.hpp>
#include <boost/assert.hpp>
@@ -73,7 +76,6 @@ namespace container {
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace container_detail {
template <class Pointer, bool IsConst>
class vec_iterator
@@ -82,7 +84,7 @@ class vec_iterator
typedef std::random_access_iterator_tag iterator_category;
typedef typename boost::intrusive::pointer_traits<Pointer>::element_type value_type;
typedef typename boost::intrusive::pointer_traits<Pointer>::difference_type difference_type;
- typedef typename if_c
+ typedef typename dtl::if_c
< IsConst
, typename boost::intrusive::pointer_traits<Pointer>::template
rebind_pointer<const value_type>::type
@@ -210,64 +212,28 @@ struct vector_insert_ordered_cursor
BiDirValueIt last_value_it;
};
-template<class T, class SizeType, class BiDirValueIt, class Comp>
-struct vector_merge_cursor
-{
- typedef SizeType size_type;
- typedef typename iterator_traits<BiDirValueIt>::reference reference;
-
- BOOST_CONTAINER_FORCEINLINE vector_merge_cursor(T *pbeg, T *plast, BiDirValueIt valueit, Comp &cmp)
- : m_pbeg(pbeg), m_pcur(--plast), m_valueit(valueit), m_cmp(cmp)
- {}
-
- void operator --()
- {
- --m_valueit;
- const T &t = *m_valueit;
- while((m_pcur + 1) != m_pbeg){
- if(!m_cmp(t, *m_pcur)){
- break;
- }
- --m_pcur;
- }
- }
-
- BOOST_CONTAINER_FORCEINLINE size_type get_pos() const
- { return static_cast<size_type>((m_pcur + 1) - m_pbeg); }
-
- BOOST_CONTAINER_FORCEINLINE reference get_val()
- { return *m_valueit; }
-
- T *const m_pbeg;
- T *m_pcur;
- BiDirValueIt m_valueit;
- Comp &m_cmp;
-};
-
-} //namespace container_detail {
+struct initial_capacity_t{};
template<class Pointer, bool IsConst>
-BOOST_CONTAINER_FORCEINLINE const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
+BOOST_CONTAINER_FORCEINLINE const Pointer &vector_iterator_get_ptr(const vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
{ return it.get_ptr(); }
template<class Pointer, bool IsConst>
-BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr(container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
+BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr(vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
{ return it.get_ptr(); }
-namespace container_detail {
-
-struct uninitialized_size_t {};
-static const uninitialized_size_t uninitialized_size = uninitialized_size_t();
+struct vector_uninitialized_size_t {};
+static const vector_uninitialized_size_t vector_uninitialized_size = vector_uninitialized_size_t();
template <class T>
struct vector_value_traits_base
{
- static const bool trivial_dctr = is_trivially_destructible<T>::value;
+ static const bool trivial_dctr = dtl::is_trivially_destructible<T>::value;
static const bool trivial_dctr_after_move = has_trivial_destructor_after_move<T>::value;
- static const bool trivial_copy = is_trivially_copy_constructible<T>::value;
- static const bool nothrow_copy = is_nothrow_copy_constructible<T>::value || trivial_copy;
- static const bool trivial_assign = is_trivially_copy_assignable<T>::value;
- static const bool nothrow_assign = is_nothrow_copy_assignable<T>::value || trivial_assign;
+ static const bool trivial_copy = dtl::is_trivially_copy_constructible<T>::value;
+ static const bool nothrow_copy = dtl::is_nothrow_copy_constructible<T>::value || trivial_copy;
+ static const bool trivial_assign = dtl::is_trivially_copy_assignable<T>::value;
+ static const bool nothrow_assign = dtl::is_nothrow_copy_assignable<T>::value || trivial_assign;
};
@@ -278,18 +244,19 @@ struct vector_value_traits
typedef vector_value_traits_base<typename Allocator::value_type> base_t;
//This is the anti-exception array destructor
//to deallocate values already constructed
- typedef typename container_detail::if_c
+ typedef typename dtl::if_c
<base_t::trivial_dctr
- ,container_detail::null_scoped_destructor_n<Allocator>
- ,container_detail::scoped_destructor_n<Allocator>
+ ,dtl::null_scoped_destructor_n<Allocator>
+ ,dtl::scoped_destructor_n<Allocator>
>::type ArrayDestructor;
//This is the anti-exception array deallocator
- typedef container_detail::scoped_array_deallocator<Allocator> ArrayDeallocator;
+ typedef dtl::scoped_array_deallocator<Allocator> ArrayDeallocator;
};
//!This struct deallocates and allocated memory
template < class Allocator
- , class AllocatorVersion = typename container_detail::version<Allocator>::type
+ , class StoredSizeType
+ , class AllocatorVersion = typename dtl::version<Allocator>::type
>
struct vector_alloc_holder
: public Allocator
@@ -298,7 +265,8 @@ struct vector_alloc_holder
BOOST_MOVABLE_BUT_NOT_COPYABLE(vector_alloc_holder)
public:
- typedef Allocator allocator_type;
+ typedef Allocator allocator_type;
+ typedef StoredSizeType stored_size_type;
typedef boost::container::allocator_traits<Allocator> allocator_traits_type;
typedef typename allocator_traits_type::pointer pointer;
typedef typename allocator_traits_type::size_type size_type;
@@ -322,7 +290,7 @@ struct vector_alloc_holder
//Constructor, does not throw
vector_alloc_holder()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: Allocator(), m_start(), m_size(), m_capacity()
{}
@@ -334,28 +302,34 @@ struct vector_alloc_holder
//Constructor, does not throw
template<class AllocConvertible>
- vector_alloc_holder(uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size)
+ vector_alloc_holder(vector_uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size)
: Allocator(boost::forward<AllocConvertible>(a))
, m_start()
- , m_size(initial_size) //Size is initialized here so vector should only call uninitialized_xxx after this
+ //Size is initialized here so vector should only call uninitialized_xxx after this
+ , m_size(static_cast<stored_size_type>(initial_size))
, m_capacity()
{
if(initial_size){
pointer reuse = pointer();
- m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
+ size_type final_cap = initial_size;
+ m_start = this->allocation_command(allocate_new, initial_size, final_cap, reuse);
+ m_capacity = static_cast<stored_size_type>(final_cap);
}
}
//Constructor, does not throw
- vector_alloc_holder(uninitialized_size_t, size_type initial_size)
+ vector_alloc_holder(vector_uninitialized_size_t, size_type initial_size)
: Allocator()
, m_start()
- , m_size(initial_size) //Size is initialized here so vector should only call uninitialized_xxx after this
+ //Size is initialized here so vector should only call uninitialized_xxx after this
+ , m_size(static_cast<stored_size_type>(initial_size))
, m_capacity()
{
if(initial_size){
pointer reuse = pointer();
- m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
+ size_type final_cap = initial_size;
+ m_start = this->allocation_command(allocate_new, initial_size, final_cap, reuse);
+ m_capacity = static_cast<stored_size_type>(final_cap);
}
}
@@ -369,17 +343,17 @@ struct vector_alloc_holder
holder.m_size = holder.m_capacity = 0;
}
- vector_alloc_holder(pointer p, size_type capacity, BOOST_RV_REF(vector_alloc_holder) holder)
+ vector_alloc_holder(initial_capacity_t, pointer p, size_type capacity, BOOST_RV_REF(vector_alloc_holder) holder)
: Allocator(BOOST_MOVE_BASE(Allocator, holder))
, m_start(p)
, m_size(holder.m_size)
- , m_capacity(capacity)
+ , m_capacity(static_cast<stored_size_type>(capacity))
{
allocator_type &this_alloc = this->alloc();
allocator_type &x_alloc = holder.alloc();
if(this->is_propagable_from(x_alloc, holder.start(), this_alloc, true)){
if(this->m_capacity){
- allocator_traits_type::deallocate(this->alloc(), this->m_start, this->m_capacity);
+ this->deallocate(this->m_start, this->m_capacity);
}
m_start = holder.m_start;
m_capacity = holder.m_capacity;
@@ -389,23 +363,26 @@ struct vector_alloc_holder
else if(this->m_capacity < holder.m_size){
size_type const n = holder.m_size;
pointer reuse = pointer();
- m_start = this->allocation_command(allocate_new, n, m_capacity = n, reuse);
+ size_type final_cap = n;
+ m_start = this->allocation_command(allocate_new, n, final_cap, reuse);
+ m_capacity = static_cast<stored_size_type>(final_cap);
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
#endif
}
}
- vector_alloc_holder(pointer p, size_type n)
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ vector_alloc_holder(initial_capacity_t, pointer p, size_type n)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: Allocator()
, m_start(p)
, m_size()
- , m_capacity(n)
+ //n is guaranteed to fit into stored_size_type
+ , m_capacity(static_cast<stored_size_type>(n))
{}
template<class AllocFwd>
- vector_alloc_holder(pointer p, size_type n, BOOST_FWD_REF(AllocFwd) a)
+ vector_alloc_holder(initial_capacity_t, pointer p, size_type n, BOOST_FWD_REF(AllocFwd) a)
: Allocator(::boost::forward<AllocFwd>(a))
, m_start(p)
, m_size()
@@ -415,17 +392,32 @@ struct vector_alloc_holder
BOOST_CONTAINER_FORCEINLINE ~vector_alloc_holder() BOOST_NOEXCEPT_OR_NOTHROW
{
if(this->m_capacity){
- allocator_traits_type::deallocate(this->alloc(), this->m_start, this->m_capacity);
+ this->deallocate(this->m_start, this->m_capacity);
}
}
BOOST_CONTAINER_FORCEINLINE pointer allocation_command(boost::container::allocation_type command,
size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse)
{
- typedef typename container_detail::version<Allocator>::type alloc_version;
+ typedef typename dtl::version<Allocator>::type alloc_version;
return this->priv_allocation_command(alloc_version(), command, limit_size, prefer_in_recvd_out_size, reuse);
}
+ BOOST_CONTAINER_FORCEINLINE pointer allocate(size_type n)
+ {
+ const size_type max_alloc = allocator_traits_type::max_size(this->alloc());
+ const size_type max = max_alloc <= stored_size_type(-1) ? max_alloc : stored_size_type(-1);
+ if ( max < n )
+ boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
+
+ return allocator_traits_type::allocate(this->alloc(), n);
+ }
+
+ BOOST_CONTAINER_FORCEINLINE void deallocate(const pointer &p, size_type n)
+ {
+ allocator_traits_type::deallocate(this->alloc(), p, n);
+ }
+
bool try_expand_fwd(size_type at_least)
{
//There is not enough memory, try to expand the old one
@@ -443,17 +435,24 @@ struct vector_alloc_holder
return success;
}
- BOOST_CONTAINER_FORCEINLINE size_type next_capacity(size_type additional_objects) const
+ template<class GrowthFactorType>
+ size_type next_capacity(size_type additional_objects) const
{
- return next_capacity_calculator
- <size_type, NextCapacityDouble //NextCapacity60Percent
- >::get( allocator_traits_type::max_size(this->alloc())
- , this->m_capacity, additional_objects );
+ BOOST_ASSERT(additional_objects > size_type(this->m_capacity - this->m_size));
+ size_type max = allocator_traits_type::max_size(this->alloc());
+ (clamp_by_stored_size_type)(max, stored_size_type());
+ const size_type remaining_cap = max - size_type(this->m_capacity);
+ const size_type min_additional_cap = additional_objects - size_type(this->m_capacity - this->m_size);
+
+ if ( remaining_cap < min_additional_cap )
+ boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
+
+ return GrowthFactorType()( size_type(this->m_capacity), min_additional_cap, max);
}
- pointer m_start;
- size_type m_size;
- size_type m_capacity;
+ pointer m_start;
+ stored_size_type m_size;
+ stored_size_type m_capacity;
void swap_resources(vector_alloc_holder &x) BOOST_NOEXCEPT_OR_NOTHROW
{
@@ -477,10 +476,14 @@ struct vector_alloc_holder
BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
{ return *this; }
- const pointer &start() const BOOST_NOEXCEPT_OR_NOTHROW { return m_start; }
- const size_type &capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return m_capacity; }
- void start(const pointer &p) BOOST_NOEXCEPT_OR_NOTHROW { m_start = p; }
- void capacity(const size_type &c) BOOST_NOEXCEPT_OR_NOTHROW { m_capacity = c; }
+ BOOST_CONTAINER_FORCEINLINE const pointer &start() const BOOST_NOEXCEPT_OR_NOTHROW
+ { return m_start; }
+ BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW
+ { return m_capacity; }
+ BOOST_CONTAINER_FORCEINLINE void start(const pointer &p) BOOST_NOEXCEPT_OR_NOTHROW
+ { m_start = p; }
+ BOOST_CONTAINER_FORCEINLINE void capacity(const size_type &c) BOOST_NOEXCEPT_OR_NOTHROW
+ { BOOST_ASSERT( c <= stored_size_type(-1)); m_capacity = c; }
private:
void priv_first_allocation(size_type cap)
@@ -495,15 +498,30 @@ struct vector_alloc_holder
}
}
+ BOOST_CONTAINER_FORCEINLINE static void clamp_by_stored_size_type(size_type &, size_type)
+ {}
+
+ template<class SomeStoredSizeType>
+ BOOST_CONTAINER_FORCEINLINE static void clamp_by_stored_size_type(size_type &s, SomeStoredSizeType)
+ {
+ if (s >= SomeStoredSizeType(-1) )
+ s = SomeStoredSizeType(-1);
+ }
+
BOOST_CONTAINER_FORCEINLINE pointer priv_allocation_command(version_1, boost::container::allocation_type command,
- size_type ,
+ size_type limit_size,
size_type &prefer_in_recvd_out_size,
pointer &reuse)
{
(void)command;
BOOST_ASSERT( (command & allocate_new));
BOOST_ASSERT(!(command & nothrow_allocation));
- pointer const p = allocator_traits_type::allocate(this->alloc(), prefer_in_recvd_out_size, reuse);
+ //First detect overflow on smaller stored_size_types
+ if (limit_size > stored_size_type(-1)){
+ boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
+ }
+ (clamp_by_stored_size_type)(prefer_in_recvd_out_size, stored_size_type());
+ pointer const p = this->allocate(prefer_in_recvd_out_size);
reuse = pointer();
return p;
}
@@ -513,13 +531,22 @@ struct vector_alloc_holder
size_type &prefer_in_recvd_out_size,
pointer &reuse)
{
- return this->alloc().allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse);
+ //First detect overflow on smaller stored_size_types
+ if (limit_size > stored_size_type(-1)){
+ boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
+ }
+ (clamp_by_stored_size_type)(prefer_in_recvd_out_size, stored_size_type());
+ //Allocate memory
+ pointer p = this->alloc().allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse);
+ //If after allocation prefer_in_recvd_out_size is not representable by stored_size_type, truncate it.
+ (clamp_by_stored_size_type)(prefer_in_recvd_out_size, stored_size_type());
+ return p;
}
};
//!This struct deallocates and allocated memory
-template <class Allocator>
-struct vector_alloc_holder<Allocator, version_0>
+template <class Allocator, class StoredSizeType>
+struct vector_alloc_holder<Allocator, StoredSizeType, version_0>
: public Allocator
{
private:
@@ -530,13 +557,14 @@ struct vector_alloc_holder<Allocator, version_0>
typedef typename allocator_traits_type::pointer pointer;
typedef typename allocator_traits_type::size_type size_type;
typedef typename allocator_traits_type::value_type value_type;
+ typedef StoredSizeType stored_size_type;
- template <class OtherAllocator, class OtherAllocatorVersion>
+ template <class OtherAllocator, class OtherStoredSizeType, class OtherAllocatorVersion>
friend struct vector_alloc_holder;
//Constructor, does not throw
vector_alloc_holder()
- BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: Allocator(), m_size()
{}
@@ -548,7 +576,7 @@ struct vector_alloc_holder<Allocator, version_0>
//Constructor, does not throw
template<class AllocConvertible>
- vector_alloc_holder(uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size)
+ vector_alloc_holder(vector_uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size)
: Allocator(boost::forward<AllocConvertible>(a))
, m_size(initial_size) //Size is initialized here...
{
@@ -557,7 +585,7 @@ struct vector_alloc_holder<Allocator, version_0>
}
//Constructor, does not throw
- vector_alloc_holder(uninitialized_size_t, size_type initial_size)
+ vector_alloc_holder(vector_uninitialized_size_t, size_type initial_size)
: Allocator()
, m_size(initial_size) //Size is initialized here...
{
@@ -573,8 +601,8 @@ struct vector_alloc_holder<Allocator, version_0>
(this->alloc(), boost::movelib::to_raw_pointer(holder.start()), m_size, boost::movelib::to_raw_pointer(this->start()));
}
- template<class OtherAllocator, class OtherAllocatorVersion>
- vector_alloc_holder(BOOST_RV_REF_BEG vector_alloc_holder<OtherAllocator, OtherAllocatorVersion> BOOST_RV_REF_END holder)
+ template<class OtherAllocator, class OtherStoredSizeType, class OtherAllocatorVersion>
+ vector_alloc_holder(BOOST_RV_REF_BEG vector_alloc_holder<OtherAllocator, OtherStoredSizeType, OtherAllocatorVersion> BOOST_RV_REF_END holder)
: Allocator()
, m_size(holder.m_size) //Initialize it to m_size as first_allocation can only succeed or abort
{
@@ -597,8 +625,8 @@ struct vector_alloc_holder<Allocator, version_0>
this->priv_deep_swap(x);
}
- template<class OtherAllocator, class OtherAllocatorVersion>
- void deep_swap(vector_alloc_holder<OtherAllocator, OtherAllocatorVersion> &x)
+ template<class OtherAllocator, class OtherStoredSizeType, class OtherAllocatorVersion>
+ void deep_swap(vector_alloc_holder<OtherAllocator, OtherStoredSizeType, OtherAllocatorVersion> &x)
{
if(this->m_size > OtherAllocator::internal_capacity || x.m_size > Allocator::internal_capacity){
throw_bad_alloc();
@@ -628,12 +656,12 @@ struct vector_alloc_holder<Allocator, version_0>
BOOST_CONTAINER_FORCEINLINE pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); }
BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; }
- size_type m_size;
+ stored_size_type m_size;
private:
- template<class OtherAllocator, class OtherAllocatorVersion>
- void priv_deep_swap(vector_alloc_holder<OtherAllocator, OtherAllocatorVersion> &x)
+ template<class OtherAllocator, class OtherStoredSizeType, class OtherAllocatorVersion>
+ void priv_deep_swap(vector_alloc_holder<OtherAllocator, OtherStoredSizeType, OtherAllocatorVersion> &x)
{
const size_type MaxTmpStorage = sizeof(value_type)*Allocator::internal_capacity;
value_type *const first_this = boost::movelib::to_raw_pointer(this->start());
@@ -649,7 +677,34 @@ struct vector_alloc_holder<Allocator, version_0>
}
};
-} //namespace container_detail {
+struct growth_factor_60;
+
+template<class T, class Default>
+struct default_if_void
+{
+ typedef T type;
+};
+
+template<class Default>
+struct default_if_void<void, Default>
+{
+ typedef Default type;
+};
+
+template<class Options, class AllocatorSizeType>
+struct get_vector_opt
+{
+ typedef vector_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
+ > type;
+};
+
+template<class AllocatorSizeType>
+struct get_vector_opt<void, AllocatorSizeType>
+{
+ typedef vector_opt<growth_factor_60, AllocatorSizeType> type;
+};
+
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -660,28 +715,32 @@ struct vector_alloc_holder<Allocator, version_0>
//!
//! \tparam T The type of object that is stored in the vector
//! \tparam Allocator The allocator used for all internal memory management
-template <class T, class Allocator BOOST_CONTAINER_DOCONLY(= new_allocator<T>) >
+//! \tparam Options A type produced from \c boost::container::vector_options.
+template <class T, class Allocator BOOST_CONTAINER_DOCONLY(= new_allocator<T>), class Options BOOST_CONTAINER_DOCONLY(= void) >
class vector
{
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
- struct value_less
- {
- typedef typename boost::container::allocator_traits<Allocator>::value_type value_type;
- bool operator()(const value_type &a, const value_type &b) const
- { return a < b; }
- };
+ typedef typename boost::container::allocator_traits<Allocator>::size_type alloc_size_type;
+ typedef typename get_vector_opt<Options, alloc_size_type>::type options_type;
+ typedef typename options_type::growth_factor_type growth_factor_type;
+ typedef typename options_type::stored_size_type stored_size_type;
+ typedef value_less<T> value_less_t;
+
+ //If provided the stored_size option must specify a type that is equal or a type that is smaller.
+ BOOST_STATIC_ASSERT( (sizeof(stored_size_type) < sizeof(alloc_size_type) ||
+ dtl::is_same<stored_size_type, alloc_size_type>::value) );
- typedef typename container_detail::version<Allocator>::type alloc_version;
- typedef boost::container::container_detail::vector_alloc_holder<Allocator> alloc_holder_t;
+ typedef typename dtl::version<Allocator>::type alloc_version;
+ typedef boost::container::vector_alloc_holder<Allocator, stored_size_type> alloc_holder_t;
alloc_holder_t m_holder;
typedef allocator_traits<Allocator> allocator_traits_type;
- template <class U, class UAllocator>
+ template <class U, class UAllocator, class UOptions>
friend class vector;
typedef typename allocator_traits_type::pointer pointer_impl;
- typedef container_detail::vec_iterator<pointer_impl, false> iterator_impl;
- typedef container_detail::vec_iterator<pointer_impl, true > const_iterator_impl;
+ typedef vec_iterator<pointer_impl, false> iterator_impl;
+ typedef vec_iterator<pointer_impl, true > const_iterator_impl;
protected:
static bool is_propagable_from(const Allocator &from_alloc, pointer_impl p, const Allocator &to_alloc, bool const propagate_allocator)
@@ -716,7 +775,7 @@ class vector
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
BOOST_COPYABLE_AND_MOVABLE(vector)
- typedef container_detail::vector_value_traits<Allocator> value_traits;
+ typedef vector_value_traits<Allocator> value_traits;
typedef constant_iterator<T, difference_type> cvalue_iterator;
protected:
@@ -724,14 +783,13 @@ class vector
BOOST_CONTAINER_FORCEINLINE void steal_resources(vector &x)
{ return this->m_holder.steal_resources(x.m_holder); }
- struct initial_capacity_t{};
template<class AllocFwd>
BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity, BOOST_FWD_REF(AllocFwd) a)
- : m_holder(initial_memory, capacity, ::boost::forward<AllocFwd>(a))
+ : m_holder(initial_capacity_t(), initial_memory, capacity, ::boost::forward<AllocFwd>(a))
{}
BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity)
- : m_holder(initial_memory, capacity)
+ : m_holder(initial_capacity_t(), initial_memory, capacity)
{}
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -748,7 +806,7 @@ class vector
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant.
- vector() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+ vector() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
: m_holder()
{}
@@ -768,7 +826,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to n.
explicit vector(size_type n)
- : m_holder(container_detail::uninitialized_size, n)
+ : m_holder(vector_uninitialized_size, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -785,7 +843,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to n.
explicit vector(size_type n, const allocator_type &a)
- : m_holder(container_detail::uninitialized_size, a, n)
+ : m_holder(vector_uninitialized_size, a, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -804,7 +862,7 @@ class vector
//!
//! <b>Note</b>: Non-standard extension
vector(size_type n, default_init_t)
- : m_holder(container_detail::uninitialized_size, n)
+ : m_holder(vector_uninitialized_size, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -823,7 +881,7 @@ class vector
//!
//! <b>Note</b>: Non-standard extension
vector(size_type n, default_init_t, const allocator_type &a)
- : m_holder(container_detail::uninitialized_size, a, n)
+ : m_holder(vector_uninitialized_size, a, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -840,7 +898,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to n.
vector(size_type n, const T& value)
- : m_holder(container_detail::uninitialized_size, n)
+ : m_holder(vector_uninitialized_size, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -857,7 +915,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to n.
vector(size_type n, const T& value, const allocator_type& a)
- : m_holder(container_detail::uninitialized_size, a, n)
+ : m_holder(vector_uninitialized_size, a, n)
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += n != 0;
@@ -875,9 +933,9 @@ class vector
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InIt>
vector(InIt first, InIt last
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c
- < container_detail::is_convertible<InIt BOOST_MOVE_I size_type>::value
- BOOST_MOVE_I container_detail::nat >::type * = 0)
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
+ < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
+ BOOST_MOVE_I dtl::nat >::type * = 0)
)
: m_holder()
{ this->assign(first, last); }
@@ -891,9 +949,9 @@ class vector
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InIt>
vector(InIt first, InIt last, const allocator_type& a
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c
- < container_detail::is_convertible<InIt BOOST_MOVE_I size_type>::value
- BOOST_MOVE_I container_detail::nat >::type * = 0)
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c
+ < dtl::is_convertible<InIt BOOST_MOVE_I size_type>::value
+ BOOST_MOVE_I dtl::nat >::type * = 0)
)
: m_holder(a)
{ this->assign(first, last); }
@@ -907,7 +965,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to the elements x contains.
vector(const vector &x)
- : m_holder( container_detail::uninitialized_size
+ : m_holder( vector_uninitialized_size
, allocator_traits_type::select_on_container_copy_construction(x.m_holder.alloc())
, x.size())
{
@@ -953,8 +1011,8 @@ class vector
//! <b>Note</b>: Non-standard extension to support static_vector
template<class OtherAllocator>
vector(BOOST_RV_REF_BEG vector<T, OtherAllocator> BOOST_RV_REF_END x
- , typename container_detail::enable_if_c
- < container_detail::is_version<OtherAllocator, 0>::value>::type * = 0
+ , typename dtl::enable_if_c
+ < dtl::is_version<OtherAllocator, 0>::value>::type * = 0
)
: m_holder(boost::move(x.m_holder))
{}
@@ -970,7 +1028,7 @@ class vector
//!
//! <b>Complexity</b>: Linear to the elements x contains.
vector(const vector &x, const allocator_type &a)
- : m_holder(container_detail::uninitialized_size, a, x.size())
+ : m_holder(vector_uninitialized_size, a, x.size())
{
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
this->num_alloc += x.size() != 0;
@@ -988,7 +1046,7 @@ class vector
//!
//! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
vector(BOOST_RV_REF(vector) x, const allocator_type &a)
- : m_holder( container_detail::uninitialized_size, a
+ : m_holder( vector_uninitialized_size, a
, is_propagable_from(x.get_stored_allocator(), x.m_holder.start(), a, true) ? 0 : x.size()
)
{
@@ -1079,10 +1137,10 @@ class vector
//!
//! <b>Note</b>: Non-standard extension to support static_vector
template<class OtherAllocator>
- BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and
+ BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
< vector&
- , container_detail::is_version<OtherAllocator, 0>
- , container_detail::is_different<OtherAllocator, allocator_type>
+ , dtl::is_version<OtherAllocator, 0>
+ , dtl::is_different<OtherAllocator, allocator_type>
>::type
operator=(BOOST_RV_REF_BEG vector<value_type, OtherAllocator> BOOST_RV_REF_END x)
{
@@ -1101,10 +1159,10 @@ class vector
//!
//! <b>Note</b>: Non-standard extension to support static_vector
template<class OtherAllocator>
- BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and
+ BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
< vector&
- , container_detail::is_version<OtherAllocator, 0>
- , container_detail::is_different<OtherAllocator, allocator_type>
+ , dtl::is_version<OtherAllocator, 0>
+ , dtl::is_different<OtherAllocator, allocator_type>
>::type
operator=(const vector<value_type, OtherAllocator> &x)
{
@@ -1122,12 +1180,12 @@ class vector
//! <b>Complexity</b>: Linear to n.
template <class InIt>
void assign(InIt first, InIt last
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_or
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_or
< void
- BOOST_MOVE_I container_detail::is_convertible<InIt BOOST_MOVE_I size_type>
- BOOST_MOVE_I container_detail::and_
- < container_detail::is_different<alloc_version BOOST_MOVE_I version_0>
- BOOST_MOVE_I container_detail::is_not_input_iterator<InIt>
+ BOOST_MOVE_I dtl::is_convertible<InIt BOOST_MOVE_I size_type>
+ BOOST_MOVE_I dtl::and_
+ < dtl::is_different<alloc_version BOOST_MOVE_I version_0>
+ BOOST_MOVE_I dtl::is_not_input_iterator<InIt>
>
>::type * = 0)
)
@@ -1171,11 +1229,11 @@ class vector
//! <b>Complexity</b>: Linear to n.
template <class FwdIt>
void assign(FwdIt first, FwdIt last
- BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_or
+ BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_or
< void
- BOOST_MOVE_I container_detail::is_same<alloc_version BOOST_MOVE_I version_0>
- BOOST_MOVE_I container_detail::is_convertible<FwdIt BOOST_MOVE_I size_type>
- BOOST_MOVE_I container_detail::is_input_iterator<FwdIt>
+ BOOST_MOVE_I dtl::is_same<alloc_version BOOST_MOVE_I version_0>
+ BOOST_MOVE_I dtl::is_convertible<FwdIt BOOST_MOVE_I size_type>
+ BOOST_MOVE_I dtl::is_input_iterator<FwdIt>
>::type * = 0)
)
{
@@ -1194,7 +1252,7 @@ class vector
pointer const old_p = this->m_holder.start();
if(old_p){
this->priv_destroy_all();
- allocator_traits_type::deallocate(this->m_holder.alloc(), old_p, old_capacity);
+ this->m_holder.deallocate(old_p, old_capacity);
}
this->m_holder.start(ret);
this->m_holder.capacity(real_cap);
@@ -1697,7 +1755,7 @@ class vector
return *p;
}
else{
- typedef container_detail::insert_emplace_proxy<Allocator, T*, Args...> type;
+ typedef dtl::insert_emplace_proxy<Allocator, T*, Args...> type;
return *this->priv_forward_range_insert_no_capacity
(this->back_ptr(), 1, type(::boost::forward<Args>(args)...), alloc_version());
}
@@ -1738,7 +1796,7 @@ class vector
{
BOOST_ASSERT(this->priv_in_range_or_end(position));
//Just call more general insert(pos, size, value) and return iterator
- typedef container_detail::insert_emplace_proxy<Allocator, T*, Args...> type;
+ typedef dtl::insert_emplace_proxy<Allocator, T*, Args...> type;
return this->priv_forward_range_insert( vector_iterator_get_ptr(position), 1
, type(::boost::forward<Args>(args)...));
}
@@ -1757,7 +1815,7 @@ class vector
return *p;\
}\
else{\
- typedef container_detail::insert_emplace_proxy_arg##N<Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
+ typedef dtl::insert_emplace_proxy_arg##N<Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
return *this->priv_forward_range_insert_no_capacity\
( this->back_ptr(), 1, type(BOOST_MOVE_FWD##N), alloc_version());\
}\
@@ -1779,7 +1837,7 @@ class vector
iterator emplace(const_iterator pos BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\
BOOST_ASSERT(this->priv_in_range_or_end(pos));\
- typedef container_detail::insert_emplace_proxy_arg##N<Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
+ typedef dtl::insert_emplace_proxy_arg##N<Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), 1, type(BOOST_MOVE_FWD##N));\
}\
//
@@ -1845,7 +1903,7 @@ class vector
iterator insert(const_iterator p, size_type n, const T& x)
{
BOOST_ASSERT(this->priv_in_range_or_end(p));
- container_detail::insert_n_copies_proxy<Allocator, T*> proxy(x);
+ dtl::insert_n_copies_proxy<Allocator, T*> proxy(x);
return this->priv_forward_range_insert(vector_iterator_get_ptr(p), n, proxy);
}
@@ -1862,10 +1920,10 @@ class vector
template <class InIt>
iterator insert(const_iterator pos, InIt first, InIt last
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<InIt, size_type>
- , container_detail::is_not_input_iterator<InIt>
+ , dtl::is_convertible<InIt, size_type>
+ , dtl::is_not_input_iterator<InIt>
>::type * = 0
#endif
)
@@ -1883,15 +1941,15 @@ class vector
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
template <class FwdIt>
iterator insert(const_iterator pos, FwdIt first, FwdIt last
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_convertible<FwdIt, size_type>
- , container_detail::is_input_iterator<FwdIt>
+ , dtl::is_convertible<FwdIt, size_type>
+ , dtl::is_input_iterator<FwdIt>
>::type * = 0
)
{
BOOST_ASSERT(this->priv_in_range_or_end(pos));
- container_detail::insert_range_proxy<Allocator, FwdIt, T*> proxy(first);
+ dtl::insert_range_proxy<Allocator, FwdIt, T*> proxy(first);
return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), boost::container::iterator_distance(first, last), proxy);
}
#endif
@@ -1916,10 +1974,10 @@ class vector
iterator insert(const_iterator pos, size_type num, InIt first, InIt last)
{
BOOST_ASSERT(this->priv_in_range_or_end(pos));
- BOOST_ASSERT(container_detail::is_input_iterator<InIt>::value ||
+ BOOST_ASSERT(dtl::is_input_iterator<InIt>::value ||
num == static_cast<size_type>(boost::container::iterator_distance(first, last)));
(void)last;
- container_detail::insert_range_proxy<Allocator, InIt, T*> proxy(first);
+ dtl::insert_range_proxy<Allocator, InIt, T*> proxy(first);
return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), num, proxy);
}
#endif
@@ -1965,7 +2023,7 @@ class vector
T *const beg_ptr = this->priv_raw_begin();
T *const new_end_ptr = ::boost::container::move(pos_ptr + 1, beg_ptr + this->m_holder.m_size, pos_ptr);
//Move elements forward and destroy last
- this->priv_destroy_last(pos_ptr == new_end_ptr);
+ this->priv_destroy_last(pos_ptr != new_end_ptr);
return iterator(p);
}
@@ -1994,12 +2052,12 @@ class vector
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant.
- void swap(vector& x)
+ BOOST_CONTAINER_FORCEINLINE void swap(vector& x)
BOOST_NOEXCEPT_IF( ((allocator_traits_type::propagate_on_container_swap::value
|| allocator_traits_type::is_always_equal::value) &&
- !container_detail::is_version<Allocator, 0>::value))
+ !dtl::is_version<Allocator, 0>::value))
{
- this->priv_swap(x, container_detail::bool_<container_detail::is_version<Allocator, 0>::value>());
+ this->priv_swap(x, dtl::bool_<dtl::is_version<Allocator, 0>::value>());
}
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -2012,11 +2070,11 @@ class vector
//!
//! <b>Note</b>: Non-standard extension to support static_vector
template<class OtherAllocator>
- void swap(vector<T, OtherAllocator> & x
- , typename container_detail::enable_if_and
+ BOOST_CONTAINER_FORCEINLINE void swap(vector<T, OtherAllocator> & x
+ , typename dtl::enable_if_and
< void
- , container_detail::is_version<OtherAllocator, 0>
- , container_detail::is_different<OtherAllocator, allocator_type>
+ , dtl::is_version<OtherAllocator, 0>
+ , dtl::is_different<OtherAllocator, allocator_type>
>::type * = 0
)
{ this->m_holder.deep_swap(x.m_holder); }
@@ -2028,19 +2086,19 @@ class vector
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- void clear() BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE void clear() BOOST_NOEXCEPT_OR_NOTHROW
{ this->priv_destroy_all(); }
//! <b>Effects</b>: Returns true if x and y are equal
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- friend bool operator==(const vector& x, const vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend bool operator==(const vector& x, const vector& y)
{ return x.size() == y.size() && ::boost::container::algo_equal(x.begin(), x.end(), y.begin()); }
//! <b>Effects</b>: Returns true if x and y are unequal
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- friend bool operator!=(const vector& x, const vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend bool operator!=(const vector& x, const vector& y)
{ return !(x == y); }
//! <b>Effects</b>: Returns true if x is less than y
@@ -2060,25 +2118,25 @@ class vector
//! <b>Effects</b>: Returns true if x is greater than y
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- friend bool operator>(const vector& x, const vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend bool operator>(const vector& x, const vector& y)
{ return y < x; }
//! <b>Effects</b>: Returns true if x is equal or less than y
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- friend bool operator<=(const vector& x, const vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend bool operator<=(const vector& x, const vector& y)
{ return !(y < x); }
//! <b>Effects</b>: Returns true if x is equal or greater than y
//!
//! <b>Complexity</b>: Linear to the number of elements in the container.
- friend bool operator>=(const vector& x, const vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend bool operator>=(const vector& x, const vector& y)
{ return !(x < y); }
//! <b>Effects</b>: x.swap(y)
//!
//! <b>Complexity</b>: Constant.
- friend void swap(vector& x, vector& y)
+ BOOST_CONTAINER_FORCEINLINE friend void swap(vector& x, vector& y)
{ x.swap(y); }
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -2099,27 +2157,51 @@ class vector
//Absolutely experimental. This function might change, disappear or simply crash!
template<class BiDirPosConstIt, class BiDirValueIt>
- void insert_ordered_at(const size_type element_count, BiDirPosConstIt last_position_it, BiDirValueIt last_value_it)
+ BOOST_CONTAINER_FORCEINLINE void insert_ordered_at(const size_type element_count, BiDirPosConstIt last_position_it, BiDirValueIt last_value_it)
{
- typedef container_detail::vector_insert_ordered_cursor<BiDirPosConstIt, BiDirValueIt> inserter_t;
+ typedef vector_insert_ordered_cursor<BiDirPosConstIt, BiDirValueIt> inserter_t;
return this->priv_insert_ordered_at(element_count, inserter_t(last_position_it, last_value_it));
}
- template<class BidirIt>
- void merge(BidirIt first, BidirIt last)
- { this->merge(first, last, value_less()); }
+ template<class InputIt>
+ BOOST_CONTAINER_FORCEINLINE void merge(InputIt first, InputIt last)
+ { this->merge(first, last, value_less_t()); }
- template<class BidirIt, class Compare>
- void merge(BidirIt first, BidirIt last, Compare comp)
- { this->priv_merge(container_detail::false_type(), first, last, comp); }
+ template<class InputIt, class Compare>
+ BOOST_CONTAINER_FORCEINLINE void merge(InputIt first, InputIt last, Compare comp)
+ {
+ size_type const s = this->size();
+ size_type const c = this->capacity();
+ size_type n = 0;
+ size_type const free_cap = c - s;
+ //If not input iterator and new elements don't fit in the remaining capacity, merge in new buffer
+ if(!dtl::is_input_iterator<InputIt>::value &&
+ free_cap < (n = static_cast<size_type>(boost::container::iterator_distance(first, last)))){
+ this->priv_merge_in_new_buffer(first, n, comp, alloc_version());
+ }
+ else{
+ iterator pos(this->insert(this->cend(), first, last));
+ T *const raw_beg = this->priv_raw_begin();
+ T *const raw_end = this->priv_raw_end();
+ T *const raw_pos = raw_beg + s;
+ boost::movelib::adaptive_merge(raw_beg, raw_pos, raw_end, comp, raw_end, free_cap - n);
+ }
+ }
- template<class BidirIt>
- void merge_unique(BidirIt first, BidirIt last)
- { this->priv_merge(container_detail::true_type(), first, last, value_less()); }
+ template<class InputIt>
+ BOOST_CONTAINER_FORCEINLINE void merge_unique(InputIt first, InputIt last)
+ { this->merge_unique(first, last, value_less_t()); }
- template<class BidirIt, class Compare>
- void merge_unique(BidirIt first, BidirIt last, Compare comp)
- { this->priv_merge(container_detail::true_type(), first, last, comp); }
+ template<class InputIt, class Compare>
+ BOOST_CONTAINER_FORCEINLINE void merge_unique(InputIt first, InputIt last, Compare comp)
+ {
+ size_type const s = this->size();
+ this->priv_set_difference_back(first, last, comp);
+ T *const raw_beg = this->priv_raw_begin();
+ T *const raw_end = this->priv_raw_end();
+ T *raw_pos = raw_beg + s;
+ boost::movelib::adaptive_merge(raw_beg, raw_pos, raw_end, comp, raw_end, this->capacity() - this->size());
+ }
private:
template<class PositionValue>
@@ -2179,43 +2261,48 @@ class vector
}
}
- template<class UniqueBool, class BidirIt, class Compare>
- void priv_merge(UniqueBool, BidirIt first, BidirIt last, Compare comp)
+ template<class InputIt, class Compare>
+ void priv_set_difference_back(InputIt first1, InputIt last1, Compare comp)
{
- size_type const n = static_cast<size_type>(boost::container::iterator_distance(first, last));
- size_type const s = this->size();
- if(BOOST_LIKELY(s)){
- size_type const c = this->capacity();
- size_type const free_c = (c - s);
- //Use a new buffer if current one is too small for new elements
- if(free_c < n){
- this->priv_merge_in_new_buffer(UniqueBool(), first, n, comp, alloc_version());
+ T * old_first2 = this->priv_raw_begin();
+ T * first2 = old_first2;
+ T * last2 = this->priv_raw_end();
+
+ while (first1 != last1) {
+ if (first2 == last2){
+ this->insert(this->cend(), first1, last1);
+ return;
}
- else{
- T *raw_pos = boost::movelib::iterator_to_raw_pointer(this->insert(this->cend(), first, last));
- T *raw_beg = this->priv_raw_begin();
- T *raw_end = this->priv_raw_end();
- boost::movelib::adaptive_merge(raw_beg, raw_pos, raw_end, comp, raw_end, free_c - n);
- if(UniqueBool::value){
- size_type const count =
- static_cast<size_type>(raw_end - boost::movelib::unique(raw_beg, raw_end, boost::movelib::negate<Compare>(comp)));
- this->priv_destroy_last_n(count);
+
+ if (comp(*first1, *first2)) {
+ this->emplace_back(*first1);
+ //Reallocation happened, update range
+ T * const raw_begin = this->priv_raw_begin();
+ if(old_first2 != raw_begin){
+ first2 = raw_begin + (first2 - old_first2);
+ last2 = first2 + (last2 - old_first2);
+ old_first2 = raw_begin;
}
+
+ ++first1;
+ }
+ else {
+ if (!comp(*first2, *first1)) {
+ ++first1;
+ }
+ ++first2;
}
- }
- else{
- this->insert(this->cend(), n, first, last);
}
}
- template<class UniqueBool, class FwdIt, class Compare>
- void priv_merge_in_new_buffer(UniqueBool, FwdIt, size_type, Compare, version_0)
+ template<class FwdIt, class Compare>
+ BOOST_CONTAINER_FORCEINLINE void priv_merge_in_new_buffer(FwdIt, size_type, Compare, version_0)
{
throw_bad_alloc();
}
- template<class UniqueBool, class FwdIt, class Compare, class Version>
- void priv_merge_in_new_buffer(UniqueBool, FwdIt first, size_type n, Compare comp, Version)
+ template<class FwdIt, class Compare, class Version>
+ void priv_merge_in_new_buffer(FwdIt first, size_type n, Compare comp, Version)
{
size_type const new_size = this->size() + n;
size_type new_cap = new_size;
@@ -2249,11 +2336,6 @@ class vector
--n;
++d_first;
}
- else if(UniqueBool::value && !comp(*pbeg, *first)){
- ++first;
- --n;
- --added;
- }
else{
allocator_traits_type::construct( this->m_holder.alloc(), d_first, boost::move(*pbeg) );
new_values_destroyer.increment_size(1u);
@@ -2266,7 +2348,7 @@ class vector
pointer const old_p = this->m_holder.start();
size_type const old_cap = this->m_holder.capacity();
boost::container::destroy_alloc_n(a, boost::movelib::to_raw_pointer(old_p), old_size);
- allocator_traits_type::deallocate(a, old_p, old_cap);
+ this->m_holder.deallocate(old_p, old_cap);
this->m_holder.m_size = old_size + added;
this->m_holder.start(new_storage);
this->m_holder.capacity(new_cap);
@@ -2274,10 +2356,10 @@ class vector
new_values_destroyer.release();
}
- bool room_enough() const
+ BOOST_CONTAINER_FORCEINLINE bool room_enough() const
{ return this->m_holder.m_size < this->m_holder.capacity(); }
- pointer back_ptr() const
+ BOOST_CONTAINER_FORCEINLINE pointer back_ptr() const
{ return this->m_holder.start() + this->m_holder.m_size; }
size_type priv_index_of(pointer p) const
@@ -2289,10 +2371,10 @@ class vector
template<class OtherAllocator>
void priv_move_assign(BOOST_RV_REF_BEG vector<T, OtherAllocator> BOOST_RV_REF_END x
- , typename container_detail::enable_if_c
- < container_detail::is_version<OtherAllocator, 0>::value >::type * = 0)
+ , typename dtl::enable_if_c
+ < dtl::is_version<OtherAllocator, 0>::value >::type * = 0)
{
- if(!container_detail::is_same<OtherAllocator, allocator_type>::value &&
+ if(!dtl::is_same<OtherAllocator, allocator_type>::value &&
this->capacity() < x.size()){
throw_bad_alloc();
}
@@ -2306,10 +2388,10 @@ class vector
template<class OtherAllocator>
void priv_move_assign(BOOST_RV_REF_BEG vector<T, OtherAllocator> BOOST_RV_REF_END x
- , typename container_detail::disable_if_or
+ , typename dtl::disable_if_or
< void
- , container_detail::is_version<OtherAllocator, 0>
- , container_detail::is_different<OtherAllocator, allocator_type>
+ , dtl::is_version<OtherAllocator, 0>
+ , dtl::is_different<OtherAllocator, allocator_type>
>::type * = 0)
{
//for move assignment, no aliasing (&x != this) is assummed.
@@ -2331,7 +2413,7 @@ class vector
}
else if(is_propagable_from_x){
this->clear();
- allocator_traits_type::deallocate(this->m_holder.alloc(), this->m_holder.m_start, this->m_holder.m_capacity);
+ this->m_holder.deallocate(this->m_holder.m_start, this->m_holder.m_capacity);
this->m_holder.steal_resources(x.m_holder);
}
//Else do a one by one move
@@ -2341,15 +2423,15 @@ class vector
);
}
//Move allocator if needed
- container_detail::move_alloc(this_alloc, x_alloc, container_detail::bool_<propagate_alloc>());
+ dtl::move_alloc(this_alloc, x_alloc, dtl::bool_<propagate_alloc>());
}
template<class OtherAllocator>
void priv_copy_assign(const vector<T, OtherAllocator> &x
- , typename container_detail::enable_if_c
- < container_detail::is_version<OtherAllocator, 0>::value >::type * = 0)
+ , typename dtl::enable_if_c
+ < dtl::is_version<OtherAllocator, 0>::value >::type * = 0)
{
- if(!container_detail::is_same<OtherAllocator, allocator_type>::value &&
+ if(!dtl::is_same<OtherAllocator, allocator_type>::value &&
this->capacity() < x.size()){
throw_bad_alloc();
}
@@ -2362,31 +2444,31 @@ class vector
}
template<class OtherAllocator>
- typename container_detail::disable_if_or
+ typename dtl::disable_if_or
< void
- , container_detail::is_version<OtherAllocator, 0>
- , container_detail::is_different<OtherAllocator, allocator_type>
+ , dtl::is_version<OtherAllocator, 0>
+ , dtl::is_different<OtherAllocator, allocator_type>
>::type
priv_copy_assign(const vector<T, OtherAllocator> &x)
{
allocator_type &this_alloc = this->m_holder.alloc();
const allocator_type &x_alloc = x.m_holder.alloc();
- container_detail::bool_<allocator_traits_type::
+ dtl::bool_<allocator_traits_type::
propagate_on_container_copy_assignment::value> flag;
if(flag && this_alloc != x_alloc){
this->clear();
this->shrink_to_fit();
}
- container_detail::assign_alloc(this_alloc, x_alloc, flag);
+ dtl::assign_alloc(this_alloc, x_alloc, flag);
this->assign( x.priv_raw_begin(), x.priv_raw_end() );
}
template<class Vector> //Template it to avoid it in explicit instantiations
- void priv_swap(Vector &x, container_detail::true_type) //version_0
+ void priv_swap(Vector &x, dtl::true_type) //version_0
{ this->m_holder.deep_swap(x.m_holder); }
template<class Vector> //Template it to avoid it in explicit instantiations
- void priv_swap(Vector &x, container_detail::false_type) //version_N
+ void priv_swap(Vector &x, dtl::false_type) //version_N
{
const bool propagate_alloc = allocator_traits_type::propagate_on_container_swap::value;
if(are_swap_propagable( this->get_stored_allocator(), this->m_holder.start()
@@ -2413,15 +2495,15 @@ class vector
big.erase(big.nth(common_elements), big.cend());
}
//And now swap the allocator
- container_detail::swap_alloc(this->m_holder.alloc(), x.m_holder.alloc(), container_detail::bool_<propagate_alloc>());
+ dtl::swap_alloc(this->m_holder.alloc(), x.m_holder.alloc(), dtl::bool_<propagate_alloc>());
}
void priv_reserve_no_capacity(size_type, version_0)
{ throw_bad_alloc(); }
- container_detail::insert_range_proxy<Allocator, boost::move_iterator<T*>, T*> priv_dummy_empty_proxy()
+ dtl::insert_range_proxy<Allocator, boost::move_iterator<T*>, T*> priv_dummy_empty_proxy()
{
- return container_detail::insert_range_proxy<Allocator, boost::move_iterator<T*>, T*>
+ return dtl::insert_range_proxy<Allocator, boost::move_iterator<T*>, T*>
(::boost::make_move_iterator((T *)0));
}
@@ -2429,7 +2511,7 @@ class vector
{
//There is not enough memory, allocate a new buffer
//Pass the hint so that allocators can take advantage of this.
- pointer const p = allocator_traits_type::allocate(this->m_holder.alloc(), new_cap, this->m_holder.m_start);
+ pointer const p = this->m_holder.allocate(new_cap);
//We will reuse insert code, so create a dummy input iterator
this->priv_forward_range_insert_new_allocation
( boost::movelib::to_raw_pointer(p), new_cap, this->priv_raw_end(), 0, this->priv_dummy_empty_proxy());
@@ -2475,7 +2557,8 @@ class vector
void priv_destroy_last(const bool moved = false) BOOST_NOEXCEPT_OR_NOTHROW
{
(void)moved;
- if(!(value_traits::trivial_dctr || (value_traits::trivial_dctr_after_move && moved))){
+ const bool skip_destructor = value_traits::trivial_dctr || (value_traits::trivial_dctr_after_move && moved);
+ if(!skip_destructor){
value_type* const p = this->priv_raw_end() - 1;
allocator_traits_type::destroy(this->get_stored_allocator(), p);
}
@@ -2512,14 +2595,14 @@ class vector
{
BOOST_ASSERT(this->priv_in_range_or_end(p));
return this->priv_forward_range_insert
- ( vector_iterator_get_ptr(p), 1, container_detail::get_insert_value_proxy<T*, Allocator>(::boost::forward<U>(x)));
+ ( vector_iterator_get_ptr(p), 1, dtl::get_insert_value_proxy<T*, Allocator>(::boost::forward<U>(x)));
}
- container_detail::insert_copy_proxy<Allocator, T*> priv_single_insert_proxy(const T &x)
- { return container_detail::insert_copy_proxy<Allocator, T*> (x); }
+ dtl::insert_copy_proxy<Allocator, T*> priv_single_insert_proxy(const T &x)
+ { return dtl::insert_copy_proxy<Allocator, T*> (x); }
- container_detail::insert_move_proxy<Allocator, T*> priv_single_insert_proxy(BOOST_RV_REF(T) x)
- { return container_detail::insert_move_proxy<Allocator, T*> (x); }
+ dtl::insert_move_proxy<Allocator, T*> priv_single_insert_proxy(BOOST_RV_REF(T) x)
+ { return dtl::insert_move_proxy<Allocator, T*> (x); }
template <class U>
void priv_push_back(BOOST_FWD_REF(U) u)
@@ -2537,14 +2620,14 @@ class vector
}
}
- container_detail::insert_n_copies_proxy<Allocator, T*> priv_resize_proxy(const T &x)
- { return container_detail::insert_n_copies_proxy<Allocator, T*>(x); }
+ BOOST_CONTAINER_FORCEINLINE dtl::insert_n_copies_proxy<Allocator, T*> priv_resize_proxy(const T &x)
+ { return dtl::insert_n_copies_proxy<Allocator, T*>(x); }
- container_detail::insert_default_initialized_n_proxy<Allocator, T*> priv_resize_proxy(default_init_t)
- { return container_detail::insert_default_initialized_n_proxy<Allocator, T*>(); }
+ BOOST_CONTAINER_FORCEINLINE dtl::insert_default_initialized_n_proxy<Allocator, T*> priv_resize_proxy(default_init_t)
+ { return dtl::insert_default_initialized_n_proxy<Allocator, T*>(); }
- container_detail::insert_value_initialized_n_proxy<Allocator, T*> priv_resize_proxy(value_init_t)
- { return container_detail::insert_value_initialized_n_proxy<Allocator, T*>(); }
+ BOOST_CONTAINER_FORCEINLINE dtl::insert_value_initialized_n_proxy<Allocator, T*> priv_resize_proxy(value_init_t)
+ { return dtl::insert_value_initialized_n_proxy<Allocator, T*>(); }
template <class U>
void priv_resize(size_type new_size, const U& u)
@@ -2560,7 +2643,7 @@ class vector
}
}
- void priv_shrink_to_fit(version_0) BOOST_NOEXCEPT_OR_NOTHROW
+ BOOST_CONTAINER_FORCEINLINE void priv_shrink_to_fit(version_0) BOOST_NOEXCEPT_OR_NOTHROW
{}
void priv_shrink_to_fit(version_1)
@@ -2569,14 +2652,14 @@ class vector
if(cp){
const size_type sz = this->size();
if(!sz){
- allocator_traits_type::deallocate(this->m_holder.alloc(), this->m_holder.m_start, cp);
+ this->m_holder.deallocate(this->m_holder.m_start, cp);
this->m_holder.m_start = pointer();
this->m_holder.m_capacity = 0;
}
else if(sz < cp){
//Allocate a new buffer.
//Pass the hint so that allocators can take advantage of this.
- pointer const p = allocator_traits_type::allocate(this->m_holder.alloc(), sz, this->m_holder.m_start);
+ pointer const p = this->m_holder.allocate(sz);
//We will reuse insert code, so create a dummy input iterator
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
@@ -2595,7 +2678,7 @@ class vector
if(cp){
const size_type sz = this->size();
if(!sz){
- allocator_traits_type::deallocate(this->m_holder.alloc(), this->m_holder.m_start, cp);
+ this->m_holder.deallocate(this->m_holder.m_start, cp);
this->m_holder.m_start = pointer();
this->m_holder.m_capacity = 0;
}
@@ -2629,10 +2712,9 @@ class vector
const size_type n_pos = pos - this->m_holder.start();
T *const raw_pos = boost::movelib::to_raw_pointer(pos);
- const size_type new_cap = this->m_holder.next_capacity(n);
+ const size_type new_cap = this->m_holder.template next_capacity<growth_factor_type>(n);
//Pass the hint so that allocators can take advantage of this.
- T * const new_buf = boost::movelib::to_raw_pointer
- (allocator_traits_type::allocate(this->m_holder.alloc(), new_cap, this->m_holder.m_start));
+ T * const new_buf = boost::movelib::to_raw_pointer(this->m_holder.allocate(new_cap));
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
++this->num_alloc;
#endif
@@ -2651,7 +2733,7 @@ class vector
//There is not enough memory, allocate a new
//buffer or expand the old one.
- size_type real_cap = this->m_holder.next_capacity(n);
+ size_type real_cap = this->m_holder.template next_capacity<growth_factor_type>(n);
pointer reuse(this->m_holder.start());
pointer const ret (this->m_holder.allocation_command
(allocate_new | expand_fwd | expand_bwd, this->m_holder.m_size + n, real_cap, reuse));
@@ -2725,7 +2807,7 @@ class vector
}
template <class InsertionProxy, class AllocVersion>
- iterator priv_forward_range_insert_at_end
+ BOOST_CONTAINER_FORCEINLINE iterator priv_forward_range_insert_at_end
(const size_type n, const InsertionProxy insert_range_proxy, AllocVersion)
{
return this->priv_forward_range_insert(this->back_ptr(), n, insert_range_proxy);
@@ -2909,10 +2991,10 @@ class vector
//If there is allocated memory, destroy and deallocate
if(!value_traits::trivial_dctr_after_move)
boost::container::destroy_alloc_n(this->get_stored_allocator(), old_buffer, this->m_holder.m_size);
- allocator_traits_type::deallocate(this->m_holder.alloc(), this->m_holder.start(), this->m_holder.capacity());
+ this->m_holder.deallocate(this->m_holder.start(), this->m_holder.capacity());
}
this->m_holder.start(new_start);
- this->m_holder.m_size = new_finish - new_start;
+ this->m_holder.m_size = size_type(new_finish - new_start);
this->m_holder.capacity(new_cap);
//All construction successful, disable rollbacks
new_values_destroyer.release();
@@ -3248,12 +3330,12 @@ class vector
}
}
- bool priv_in_range(const_iterator pos) const
+ BOOST_CONTAINER_FORCEINLINE bool priv_in_range(const_iterator pos) const
{
return (this->begin() <= pos) && (pos < this->end());
}
- bool priv_in_range_or_end(const_iterator pos) const
+ BOOST_CONTAINER_FORCEINLINE bool priv_in_range_or_end(const_iterator pos) const
{
return (this->begin() <= pos) && (pos <= this->end());
}