Merge pull request #1 from boostorg/develop

update to original
This commit is contained in:
Tobias Loew
2018-11-21 13:12:12 +01:00
committed by GitHub
34 changed files with 955 additions and 367 deletions

View File

@@ -77,7 +77,8 @@ instructions, that's already been done for you.
* Visual C++ >= 7.1.
* GCC >= 4.1.
* Intel C++ >= 9.0
[warning GCC < 4.3 and MSVC < 9.0 are deprecated and will be removed in the next version.]
[endsect]
@@ -365,8 +366,8 @@ operations provide stronger exception safety guarantees than in vector:
[[erase] [no-throw unless copy/move construction/assignment of `T` throw (basic)] [no-throw]]
]
[*Memory overhead]. The C++ standard does not specifiy requirements on memory consumption, but virtually any implementation
of `vector` has the same behavior wih respect to memory usage: the memory allocated by a `vector` v with n elements of type T
[*Memory overhead]. The C++ standard does not specify requirements on memory consumption, but virtually any implementation
of `vector` has the same behavior with respect to memory usage: the memory allocated by a `vector` v with n elements of type T
is
m[sub v] = c\u2219e,
@@ -1242,6 +1243,8 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes_boost_1_69_00 Boost 1.69 Release]
* Deprecated GCC < 4.3 and MSVC < 9.0 (Visual 2008) compilers.
* Implemented C++20 `contains()` for associative containers as specified in
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html
P0458R2: Checking for Existence of an Element in Associative Containers].
@@ -1249,7 +1252,17 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed serious bug in heterogeneous lookup functions (is_transparent was broken).
* Fixed bugs:
* [@https://github.com/boostorg/container/issues/77 GitHub #77: ['"warning: 'sbrk' is deprecated"]].
* [@https://github.com/boostorg/container/issues/79 GitHub #79: ['"Mark small_vector move operations noexcept"]].
* [@https://github.com/boostorg/container/issues/80 GitHub #80: ['"flat_map deduction guides are ambiguous"]].
* [@https://github.com/boostorg/container/issues/81 GitHub #81: ['"Vector with custom allocator does not support value types with operator&"]].
* [@https://github.com/boostorg/container/issues/82 GitHub #82: ['"Function definition in header file"]].
* [@https://github.com/boostorg/container/issues/83 GitHub #83: ['"Iterator zero incrementing leads to assert on empty vector"]].
* [@https://github.com/boostorg/container/pull/84 GitHub #84: ['"Allow vector to be assigned to itself"]].
* [@https://github.com/boostorg/container/pull/85 GitHub #85: ['"container: misc-typos"]].
* [@https://github.com/boostorg/container/pull/86 GitHub #86: ['"Add missing warning re-enabling include"]].
* [@https://github.com/boostorg/container/issues/89 GitHub #89: ['"UBSAN failures detected in preflight CI PR"]].
* [@https://github.com/boostorg/container/issues/90 GitHub #90: ['"Build fails on clang-5 with libstdc++7-dev (C++17 issue)"]].
[endsect]

View File

@@ -31,7 +31,7 @@ int main ()
list<non_copy_movable> l;
non_copy_movable ncm;
//A new element will be built calling non_copy_movable(int) contructor
//A new element will be built calling non_copy_movable(int) constructor
l.emplace(l.begin(), 0);
assert(l.size() == 1);

View File

@@ -151,7 +151,7 @@ struct allocator_traits
//! Allocator::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.
//!
typedef see_documentation void_pointer;
//! Allocator::const_void_pointer if such a type exists ; otherwis e, pointer_traits<pointer>::rebind<const
//! Allocator::const_void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
//!
typedef see_documentation const_void_pointer;
//! Allocator::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.

View File

@@ -2238,7 +2238,7 @@ class deque : protected deque_base<Allocator>
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
deque(InputIterator, InputIterator) -> deque<typename iterator_traits<InputIterator>::value_type>;
template <typename InputIterator, typename Allocator>

View File

@@ -23,6 +23,7 @@
#include <boost/intrusive/detail/iterator.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/container/detail/mpl.hpp>
namespace boost {
namespace container {
@@ -63,6 +64,18 @@ class back_emplacer
back_emplacer& operator++(int){ return *this; }
};
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template<class InputIterator>
using it_based_non_const_first_type_t = typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type;
template<class InputIterator>
using it_based_second_type_t = typename iterator_traits<InputIterator>::value_type::second_type;
template<class InputIterator>
using it_based_value_type_t = typename iterator_traits<InputIterator>::value_type;
#endif
} //namespace container {
} //namespace boost {

View File

@@ -61,6 +61,7 @@ using boost::move_detail::enable_if_and;
using boost::move_detail::disable_if_and;
using boost::move_detail::enable_if_or;
using boost::move_detail::disable_if_or;
using boost::move_detail::remove_const;
template <class FirstType>
struct select1st
@@ -102,6 +103,36 @@ struct enable_if_transparent
: boost::move_detail::enable_if_c<dtl::is_transparent<C>::value, R>
{};
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
// void_t (void_t for C++11)
template<typename...> using variadic_void_t = void;
// Trait to detect Allocator-like types.
template<typename Allocator, typename = void>
struct is_allocator
{
static const bool value = false;
};
template <typename T>
T&& ctad_declval();
template<typename Allocator>
struct is_allocator < Allocator,
variadic_void_t< typename Allocator::value_type
, decltype(ctad_declval<Allocator&>().allocate(size_t{})) >>
{
static const bool value = true;
};
template<class T>
using require_allocator_t = typename enable_if_c<is_allocator<T>::value, T>::type;
template<class T>
using require_nonallocator_t = typename enable_if_c<!is_allocator<T>::value, T>::type;
#endif
} //namespace dtl {
} //namespace container {

View File

@@ -171,11 +171,16 @@ class basic_multiallocation_chain
std::pair<void_pointer, void_pointer> extract_data()
{
std::pair<void_pointer, void_pointer> ret
(slist_impl_.begin().operator->()
,slist_impl_.last().operator->());
slist_impl_.clear();
return ret;
if(BOOST_LIKELY(!slist_impl_.empty())){
std::pair<void_pointer, void_pointer> ret
(slist_impl_.begin().operator->()
,slist_impl_.last().operator->());
slist_impl_.clear();
return ret;
}
else {
return std::pair<void_pointer, void_pointer>();
}
}
};

View File

@@ -176,4 +176,6 @@ class thread_mutex
#endif //BOOST_HAS_PTHREADS
#include <boost/container/detail/config_end.hpp>
#endif // #ifndef BOOST_CONTAINER_DETAIL_THREAD_MUTEX_HPP

View File

@@ -119,4 +119,11 @@
#define BOOST_CONTAINER_ASAN
#endif
#if (__cplusplus >= 201703L)
//CTAD supported
#else
#define BOOST_CONTAINER_NO_CXX17_CTAD
#endif
#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP

View File

@@ -319,6 +319,21 @@ class flat_map
: m_flat_tree(ordered_range, first, last, comp, dtl::force<const impl_allocator_type>(a))
{}
//! <b>Effects</b>: Constructs an empty flat_map using the specified allocator and
//! inserts elements from the ordered range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_map(ordered_unique_range_t, InputIterator first, InputIterator last, const allocator_type& a)
: m_flat_tree(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty flat_map and
//! inserts elements from the range [il.begin() ,il.end()).
@@ -1563,89 +1578,63 @@ class flat_map
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
flat_map(InputIterator, InputIterator) ->
flat_map< typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
#ifdef BOOST_HAS_CTAD_SFINAE
namespace dtl {
template<class T, class U>
using enable_if_allocator_t = std::enable_if_t<std::is_same_v<decltype(std::declval<T>().allocate(0)), U *>, T>;
template<class T, class U>
using enable_if_compare_t = std::enable_if_t<std::is_same_v<decltype(std::declval<T>()(std::declval<U>(), std::declval<U>())), bool>, T>;
} // namespace dtl
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_map(InputIterator, InputIterator, Allocator const&) ->
flat_map< typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
, dtl::enable_if_allocator_t<Allocator, std::remove_const_t<typename iterator_traits<InputIterator>::value_type>>>;
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_map(InputIterator, InputIterator, Compare const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, dtl::enable_if_compare_t<Compare, std::remove_const_t<typename iterator_traits<InputIterator>::value_type::first_type>>>;
#else
template <typename InputIterator, typename Compare>
flat_map(InputIterator, InputIterator, Compare const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
#endif
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_map(InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
flat_map(ordered_unique_range_t, InputIterator, InputIterator) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
#ifdef BOOST_HAS_CTAD_SFINAE
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
, dtl::enable_if_allocator_t<Allocator, std::remove_const_t<typename iterator_traits<InputIterator>::value_type>>>;
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, dtl::enable_if_compare_t<Compare, std::remove_const_t<typename iterator_traits<InputIterator>::value_type::first_type>>>;
#else
template <typename InputIterator, typename Compare>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
#endif
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
flat_map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
@@ -1912,6 +1901,21 @@ class flat_multimap
: m_flat_tree(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
//! inserts elements from the ordered range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_multimap(ordered_range_t, InputIterator first, InputIterator last, const allocator_type &a)
: m_flat_tree(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty flat_map and
//! inserts elements from the range [il.begin(), il.end()).
@@ -2880,82 +2884,65 @@ class flat_multimap
{ x.swap(y); }
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
flat_multimap(InputIterator, InputIterator) ->
flat_multimap<typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
#ifdef BOOST_HAS_CTAD_SFINAE
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_multimap(InputIterator, InputIterator, Allocator const&) ->
flat_multimap<typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
, dtl::enable_if_allocator_t<Allocator, std::remove_const_t<typename iterator_traits<InputIterator>::value_type>>>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_multimap(InputIterator, InputIterator, Compare const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, dtl::enable_if_compare_t<Compare, std::remove_const_t<typename iterator_traits<InputIterator>::value_type::first_type>>>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
#else
template <typename InputIterator, typename Compare>
flat_multimap(InputIterator, InputIterator, Compare const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, Compare>;
#endif
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_multimap(InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, Compare
, Allocator>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
flat_multimap(ordered_range_t, InputIterator, InputIterator) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
#ifdef BOOST_HAS_CTAD_SFINAE
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Allocator const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
, dtl::enable_if_allocator_t<Allocator, std::remove_const_t<typename iterator_traits<InputIterator>::value_type>>>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Compare const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, dtl::enable_if_compare_t<Compare, std::remove_const_t<typename iterator_traits<InputIterator>::value_type::first_type>>>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
#else
template <typename InputIterator, typename Compare>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Compare const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, Compare>;
#endif
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_multimap(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, Compare
, Allocator>;
flat_multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
#endif

View File

@@ -257,6 +257,22 @@ class flat_set
: tree_t(ordered_unique_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty container using the specified allocator and
//! inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE
flat_set(ordered_unique_range_t, InputIterator first, InputIterator last, const allocator_type& a)
: tree_t(ordered_unique_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty container and
//! inserts elements from the range [il.begin(), il.end()).
@@ -1108,39 +1124,57 @@ class flat_set
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
flat_set(InputIterator, InputIterator) ->
flat_set<typename iterator_traits<InputIterator>::value_type>;
flat_set< it_based_value_type_t<InputIterator> >;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_set(InputIterator, InputIterator, Allocator const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, std::less<typename iterator_traits<InputIterator>::value_type>, Allocator>;
flat_set< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_set(InputIterator, InputIterator, Compare const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, Compare>;
flat_set< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_set(InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
flat_set< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
flat_set(ordered_unique_range_t, InputIterator, InputIterator) ->
flat_set<typename iterator_traits<InputIterator>::value_type>;
flat_set< it_based_value_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, std::less<typename iterator_traits<InputIterator>::value_type>, Allocator>;
flat_set< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, Compare>;
flat_set< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_set<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
flat_set< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
#endif
@@ -1320,6 +1354,20 @@ class flat_multiset
: tree_t(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty flat_multiset using the specified allocator and
//! inserts elements from the ordered range [first ,last ). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE flat_multiset(ordered_range_t, InputIterator first, InputIterator last, const allocator_type &a)
: tree_t(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! @copydoc ::boost::container::flat_set::flat_set(std::initializer_list<value_type)
BOOST_CONTAINER_FORCEINLINE flat_multiset(std::initializer_list<value_type> il)
@@ -1805,43 +1853,57 @@ class flat_multiset
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
flat_multiset(InputIterator, InputIterator) ->
flat_multiset<typename iterator_traits<InputIterator>::value_type>;
flat_multiset< it_based_value_type_t<InputIterator> >;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_multiset(InputIterator, InputIterator, Allocator const&) ->
flat_multiset< typename iterator_traits<InputIterator>::value_type
, std::less<typename iterator_traits<InputIterator>::value_type>
, Allocator>;
flat_multiset< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_multiset(InputIterator, InputIterator, Compare const&) ->
flat_multiset<typename iterator_traits<InputIterator>::value_type, Compare>;
flat_multiset< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_multiset(InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
flat_multiset< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
flat_multiset(ordered_range_t, InputIterator, InputIterator) ->
flat_multiset<typename iterator_traits<InputIterator>::value_type>;
flat_multiset< it_based_value_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Allocator const&) ->
flat_multiset< typename iterator_traits<InputIterator>::value_type
, std::less<typename iterator_traits<InputIterator>::value_type>
, Allocator>;
flat_multiset< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Compare const&) ->
flat_multiset< typename iterator_traits<InputIterator>::value_type, Compare>;
flat_multiset< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
flat_multiset(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
flat_multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
flat_multiset< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
#endif

View File

@@ -1498,7 +1498,7 @@ class list
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
list(InputIterator, InputIterator) ->
list<typename iterator_traits<InputIterator>::value_type>;

View File

@@ -256,6 +256,22 @@ class map
: base_t(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty map using the specified allocator object and
//! inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE map(ordered_unique_range_t, InputIterator first, InputIterator last, const allocator_type& a)
: base_t(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty map and
//! inserts elements from the range [il.begin(), il.end()).
@@ -1279,55 +1295,63 @@ class map
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
map(InputIterator, InputIterator) ->
map< typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
map(InputIterator, InputIterator, Allocator const&) ->
map< typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
map(InputIterator, InputIterator, Compare const&) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
map(InputIterator, InputIterator, Compare const&, Allocator const&) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
map(ordered_unique_range_t, InputIterator, InputIterator) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
map(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
map(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
map< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
map< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
@@ -1552,6 +1576,20 @@ class multimap
: base_t(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty multimap using the specified allocator and
//! inserts elements from the ordered range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE multimap(ordered_range_t, InputIterator first, InputIterator last, const allocator_type& a)
: base_t(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty multimap and
//! and inserts elements from the range [il.begin(), il.end()).
@@ -2184,58 +2222,65 @@ class multimap
#endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
multimap(InputIterator, InputIterator) ->
multimap<typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
multimap(InputIterator, InputIterator, Allocator const&) ->
multimap<typename dtl::remove_const< typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
, Allocator>;
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
multimap(InputIterator, InputIterator, Compare const&) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
multimap(InputIterator, InputIterator, Compare const&, Allocator const&) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
multimap(ordered_range_t, InputIterator, InputIterator) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type>;
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
multimap(ordered_range_t, InputIterator, InputIterator, Allocator const&) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
, std::less<typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type>
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, std::less<it_based_non_const_first_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
multimap(ordered_range_t, InputIterator, InputIterator, Compare const&) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
multimap(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
multimap< typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type
, typename iterator_traits<InputIterator>::value_type::second_type
multimap< it_based_non_const_first_type_t<InputIterator>
, it_based_second_type_t<InputIterator>
, Compare
, Allocator>;
#endif
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED

View File

@@ -172,7 +172,7 @@ class resource_adaptor
{}
explicit resource_adaptor(BOOST_RV_REF(Allocator) a2)
: base_t(BOOST_MOVE_BASE(base_t, a2))
: base_t(::boost::move(a2))
{}
resource_adaptor& operator=(BOOST_COPY_ASSIGN_REF(resource_adaptor) other)

View File

@@ -227,6 +227,21 @@ class set
: base_t(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty set using the specified allocator and
//! inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE set(ordered_unique_range_t, InputIterator first, InputIterator last, const allocator_type& a)
: base_t(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! <b>Effects</b>: Constructs an empty set and
//! inserts elements from the range [il.begin(), il.end()).
@@ -944,39 +959,57 @@ class set
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
set(InputIterator, InputIterator) ->
set<typename iterator_traits<InputIterator>::value_type>;
set< it_based_value_type_t<InputIterator> >;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
set(InputIterator, InputIterator, Allocator const&) ->
set<typename iterator_traits<InputIterator>::value_type, std::less<typename iterator_traits<InputIterator>::value_type>, Allocator>;
set< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
set(InputIterator, InputIterator, Compare const&) ->
set<typename iterator_traits<InputIterator>::value_type, Compare>;
set< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
set(InputIterator, InputIterator, Compare const&, Allocator const&) ->
set<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
set< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
set(ordered_unique_range_t, InputIterator, InputIterator) ->
set<typename iterator_traits<InputIterator>::value_type>;
set< it_based_value_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
set(ordered_unique_range_t, InputIterator, InputIterator, Allocator const&) ->
set<typename iterator_traits<InputIterator>::value_type, std::less<typename iterator_traits<InputIterator>::value_type>, Allocator>;
set< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&) ->
set<typename iterator_traits<InputIterator>::value_type, Compare>;
set< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
set(ordered_unique_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
set<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
set< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
#endif
@@ -1150,6 +1183,20 @@ class multiset
: base_t(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Constructs an empty multiset using the specified allocator and
//! inserts elements from the ordered range [first ,last ). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
//!
//! <b>Complexity</b>: Linear in N.
//!
//! <b>Note</b>: Non-standard extension.
template <class InputIterator>
BOOST_CONTAINER_FORCEINLINE multiset(ordered_range_t, InputIterator first, InputIterator last, const allocator_type &a)
: base_t(ordered_range, first, last, Compare(), a)
{}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! @copydoc ::boost::container::set::set(std::initializer_list<value_type>)
BOOST_CONTAINER_FORCEINLINE multiset(std::initializer_list<value_type> il)
@@ -1573,43 +1620,57 @@ class multiset
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
multiset(InputIterator, InputIterator) ->
multiset<typename iterator_traits<InputIterator>::value_type>;
multiset< it_based_value_type_t<InputIterator> >;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
multiset(InputIterator, InputIterator, Allocator const&) ->
multiset< typename iterator_traits<InputIterator>::value_type
, std::less<typename iterator_traits<InputIterator>::value_type>
, Allocator>;
multiset< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
multiset(InputIterator, InputIterator, Compare const&) ->
multiset<typename iterator_traits<InputIterator>::value_type, Compare>;
multiset< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
multiset(InputIterator, InputIterator, Compare const&, Allocator const&) ->
multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
multiset< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
template <typename InputIterator>
multiset(ordered_range_t, InputIterator, InputIterator) ->
multiset<typename iterator_traits<InputIterator>::value_type>;
multiset< it_based_value_type_t<InputIterator>>;
template <typename InputIterator, typename Allocator>
template < typename InputIterator, typename Allocator
, typename = dtl::require_allocator_t<Allocator>>
multiset(ordered_range_t, InputIterator, InputIterator, Allocator const&) ->
multiset< typename iterator_traits<InputIterator>::value_type
, std::less<typename iterator_traits<InputIterator>::value_type>
, Allocator>;
multiset< it_based_value_type_t<InputIterator>
, std::less<it_based_value_type_t<InputIterator>>
, Allocator>;
template <typename InputIterator, typename Compare>
template < typename InputIterator, typename Compare
, typename = dtl::require_nonallocator_t<Compare>>
multiset(ordered_range_t, InputIterator, InputIterator, Compare const&) ->
multiset< typename iterator_traits<InputIterator>::value_type, Compare>;
multiset< it_based_value_type_t<InputIterator>
, Compare>;
template <typename InputIterator, typename Compare, typename Allocator>
template < typename InputIterator, typename Compare, typename Allocator
, typename = dtl::require_nonallocator_t<Compare>
, typename = dtl::require_allocator_t<Allocator>>
multiset(ordered_range_t, InputIterator, InputIterator, Compare const&, Allocator const&) ->
multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
multiset< it_based_value_type_t<InputIterator>
, Compare
, Allocator>;
#endif

View File

@@ -1668,7 +1668,7 @@ class slist
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InpIt>
slist(InpIt, InpIt) ->

View File

@@ -608,6 +608,7 @@ class small_vector : public small_vector_base<T, Allocator>
{ this->move_construct_impl(other, other.get_stored_allocator()); }
BOOST_CONTAINER_FORCEINLINE small_vector(BOOST_RV_REF(small_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value)
: base_type(initial_capacity_t(), internal_capacity(), ::boost::move(other.get_stored_allocator()))
{ this->move_construct_impl(other, other.get_stored_allocator()); }
@@ -627,6 +628,9 @@ class small_vector : public small_vector_base<T, Allocator>
{ return static_cast<small_vector&>(this->base_type::operator=(static_cast<base_type const&>(other))); }
BOOST_CONTAINER_FORCEINLINE small_vector& operator=(BOOST_RV_REF(small_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value
&& (allocator_traits_type::propagate_on_container_move_assignment::value
|| allocator_traits_type::is_always_equal::value))
{ return static_cast<small_vector&>(this->base_type::operator=(BOOST_MOVE_BASE(base_type, other))); }
BOOST_CONTAINER_FORCEINLINE small_vector& operator=(const base_type &other)

View File

@@ -837,7 +837,7 @@ class stable_vector
BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value
|| allocator_traits_type::is_always_equal::value)
{
//for move constructor, no aliasing (&x != this) is assummed.
//for move constructor, no aliasing (&x != this) is assumed.
BOOST_ASSERT(this != &x);
node_allocator_type &this_alloc = this->priv_node_alloc();
node_allocator_type &x_alloc = x.priv_node_alloc();
@@ -2142,7 +2142,7 @@ class stable_vector
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
stable_vector(InputIterator, InputIterator) ->

View File

@@ -96,7 +96,7 @@ class static_storage_allocator
//! Insertion beyond the capacity result in throwing std::bad_alloc() if exceptions are enabled or
//! calling throw_bad_alloc() if not enabled.
//!
//! std::out_of_range is thrown if out of bound access is performed in <code>at()</code> if exceptions are
//! std::out_of_range is thrown if out of bounds access is performed in <code>at()</code> if exceptions are
//! enabled, throw_out_of_range() if not enabled.
//!
//!@tparam Value The type of element that will be stored.
@@ -372,6 +372,7 @@ public:
//! @par Complexity
//! Linear O(N).
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(BOOST_RV_REF(static_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value)
{
return static_cast<static_vector&>(base_t::operator=(BOOST_MOVE_BASE(base_t, other)));
}

View File

@@ -896,7 +896,7 @@ class basic_string
BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value
|| allocator_traits_type::is_always_equal::value)
{
//for move constructor, no aliasing (&x != this) is assummed.
//for move constructor, no aliasing (&x != this) is assumed.
BOOST_ASSERT(this != &x);
allocator_type &this_alloc = this->alloc();
allocator_type &x_alloc = x.alloc();
@@ -2978,7 +2978,7 @@ class basic_string
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
basic_string(InputIterator, InputIterator) ->

View File

@@ -145,19 +145,19 @@ class vec_iterator
//Arithmetic
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator+=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!m_ptr); m_ptr += off; return *this; }
{ BOOST_ASSERT(m_ptr || !off); m_ptr += off; return *this; }
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator-=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!m_ptr); m_ptr -= off; return *this; }
{ BOOST_ASSERT(m_ptr || !off); m_ptr -= off; return *this; }
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(const vec_iterator &x, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!x.m_ptr); return vec_iterator(x.m_ptr+off); }
{ BOOST_ASSERT(x.m_ptr || !off); return vec_iterator(x.m_ptr+off); }
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(difference_type off, vec_iterator right) BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!right.m_ptr); right.m_ptr += off; return right; }
{ BOOST_ASSERT(right.m_ptr || !off); right.m_ptr += off; return right; }
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator-(vec_iterator left, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
{ BOOST_ASSERT(!!left.m_ptr); left.m_ptr -= off; return left; }
{ BOOST_ASSERT(left.m_ptr || !off); left.m_ptr -= off; return left; }
BOOST_CONTAINER_FORCEINLINE friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) BOOST_NOEXCEPT_OR_NOTHROW
{ return left.m_ptr - right.m_ptr; }
@@ -1131,7 +1131,6 @@ class vector
BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value
|| allocator_traits_type::is_always_equal::value)
{
BOOST_ASSERT(&x != this);
this->priv_move_assign(boost::move(x));
return *this;
}
@@ -2406,8 +2405,9 @@ class vector
, dtl::is_different<OtherAllocator, allocator_type>
>::type * = 0)
{
//for move assignment, no aliasing (&x != this) is assummed.
BOOST_ASSERT(this != &x);
//for move assignment, no aliasing (&x != this) is assumed.
//x.size() == 0 is allowed for buggy std libraries.
BOOST_ASSERT(this != &x || x.size() == 0);
allocator_type &this_alloc = this->m_holder.alloc();
allocator_type &x_alloc = x.m_holder.alloc();
const bool propagate_alloc = allocator_traits_type::propagate_on_container_move_assignment::value;
@@ -2425,7 +2425,8 @@ class vector
}
else if(is_propagable_from_x){
this->clear();
this->m_holder.deallocate(this->m_holder.m_start, this->m_holder.m_capacity);
if(BOOST_LIKELY(!!this->m_holder.m_start))
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
@@ -2489,6 +2490,9 @@ class vector
this->m_holder.swap_resources(x.m_holder);
}
else{
if (BOOST_UNLIKELY(&x == this))
return;
//Else swap element by element...
bool const t_smaller = this->size() < x.size();
vector &sml = t_smaller ? *this : x;
@@ -2664,7 +2668,8 @@ class vector
if(cp){
const size_type sz = this->size();
if(!sz){
this->m_holder.deallocate(this->m_holder.m_start, cp);
if(BOOST_LIKELY(!!this->m_holder.m_start))
this->m_holder.deallocate(this->m_holder.m_start, cp);
this->m_holder.m_start = pointer();
this->m_holder.m_capacity = 0;
}
@@ -2690,7 +2695,8 @@ class vector
if(cp){
const size_type sz = this->size();
if(!sz){
this->m_holder.deallocate(this->m_holder.m_start, cp);
if(BOOST_LIKELY(!!this->m_holder.m_start))
this->m_holder.deallocate(this->m_holder.m_start, cp);
this->m_holder.m_start = pointer();
this->m_holder.m_capacity = 0;
}
@@ -3364,7 +3370,7 @@ class vector
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
template <typename InputIterator>
vector(InputIterator, InputIterator) ->

View File

@@ -1762,7 +1762,7 @@ static FORCEINLINE int win32munmap(void* ptr, size_t size) {
#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
#endif /* HAVE_MMAP && HAVE_MREMAP */
/* mstate bit set if continguous morecore disabled or failed */
/* mstate bit set if contiguous morecore disabled or failed */
#define USE_NONCONTIGUOUS_BIT (4U)
/* segment bit set in create_mspace_with_base */
@@ -4676,7 +4676,7 @@ void* dlmalloc(size_t bytes) {
void dlfree(void* mem) {
/*
Consolidate freed chunks with preceeding or succeeding bordering
Consolidate freed chunks with preceding or succeeding bordering
free chunks, if they exist, and then place in a bin. Intermixed
with special cases for top, dv, mmapped chunks, and usage errors.
*/
@@ -6210,10 +6210,10 @@ History:
Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
* Use last_remainder in more cases.
* Pack bins using idea from colin@nyx10.cs.du.edu
* Use ordered bins instead of best-fit threshhold
* Use ordered bins instead of best-fit threshold
* Eliminate block-local decls to simplify tracing and debugging.
* Support another case of realloc via move into top
* Fix error occuring when initial sbrk_base not word-aligned.
* Fix error occurring when initial sbrk_base not word-aligned.
* Rely on page size for units instead of SBRK_UNIT to
avoid surprises about sbrk alignment conventions.
* Add mallinfo, mallopt. Thanks to Raymond Nijssen

View File

@@ -19,6 +19,8 @@
#define MSPACES 1
#define NO_MALLINFO 1
#define NO_MALLOC_STATS 1
//disable sbrk as it's deprecated in some systems and weakens ASLR
#define HAVE_MORECORE 0
#if !defined(NDEBUG)
@@ -788,7 +790,7 @@ static int internal_node_multialloc
/*Error if wrong element_size parameter */
if (!element_size ||
/*OR Error if n_elements less thatn contiguous_elements */
/*OR Error if n_elements less than contiguous_elements */
((contiguous_elements + 1) > (DL_MULTIALLOC_DEFAULT_CONTIGUOUS + 1) && n_elements < contiguous_elements) ||
/* OR Error if integer overflow */
(SQRT_MAX_SIZE_T < (element_req_size | contiguous_elements) &&

View File

@@ -268,7 +268,7 @@ bool do_test()
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
//Check Constructor Template Auto Deduction
{
auto gold = MyStdDeque{ 1, 2, 3 };

View File

@@ -178,28 +178,98 @@ bool flat_tree_ordered_insertion_test()
bool constructor_template_auto_deduction_test()
{
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
using namespace boost::container;
const std::size_t NumElements = 100;
//Ordered insertion map
{
std::map<int, int> int_map;
for(std::size_t i = 0; i != NumElements; ++i){
int_map.insert(std::map<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
//Construction insertion
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end());
if(!CheckEqualContainers(int_map, fmap))
return false;
std::multimap<int, int> int_mmap;
for(std::size_t i = 0; i != NumElements; ++i){
for (std::size_t i = 0; i != NumElements; ++i) {
int_mmap.insert(std::multimap<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
//Construction insertion
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end());
if(!CheckEqualContainers(int_mmap, fmmap))
return false;
typedef std::less<int> comp_int_t;
typedef std::allocator<std::pair<int, int> > alloc_pair_int_t;
//range
{
auto fmap = flat_map(int_map.begin(), int_map.end());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(int_mmap.begin(), int_mmap.end());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp
{
auto fmap = flat_map(int_map.begin(), int_map.end(), comp_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(int_mmap.begin(), int_mmap.end(), comp_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp+alloc
{
auto fmap = flat_map(int_map.begin(), int_map.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(int_mmap.begin(), int_mmap.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+alloc
{
auto fmap = flat_map(int_map.begin(), int_map.end(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(int_mmap.begin(), int_mmap.end(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//ordered_unique_range / ordered_range
//range
{
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end());
if(!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end());
if(!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp
{
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end(), comp_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end(), comp_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp+alloc
{
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+alloc
{
auto fmap = flat_map(ordered_unique_range, int_map.begin(), int_map.end(),alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = flat_multimap(ordered_range, int_mmap.begin(), int_mmap.end(),alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
}
#endif
@@ -476,7 +546,7 @@ bool test_heterogeneous_lookups()
int main()
{
using namespace boost::container::test;
/*
//Allocator argument container
{
flat_map<int, int> map_((flat_map<int, int>::allocator_type()));
@@ -530,7 +600,7 @@ int main()
if (!test_heterogeneous_lookups())
return 1;
*/
////////////////////////////////////
// Testing allocator implementations
////////////////////////////////////
@@ -546,7 +616,7 @@ int main()
std::cout << "Error in map_test<std::allocator<void> >" << std::endl;
return 1;
}
/*
if (0 != test::map_test
< GetMapContainer<new_allocator<void> >::apply<int>::map_type
, MyStdMap
@@ -581,9 +651,9 @@ int main()
, MyStdMultiMap>()) {
std::cout << "Error in map_test<new_allocator<void> >" << std::endl;
return 1;
}*/
}
}
/*
if(!boost::container::test::test_map_support_for_initialization_list_for<flat_map<int, int> >())
return 1;
@@ -628,7 +698,7 @@ int main()
return 1;
}
}
*/
return 0;
}

View File

@@ -276,6 +276,106 @@ bool flat_tree_ordered_insertion_test()
return true;
}
bool constructor_template_auto_deduction_test()
{
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
using namespace boost::container;
const std::size_t NumElements = 100;
{
std::set<int> int_set;
for (std::size_t i = 0; i != NumElements; ++i) {
int_set.insert(static_cast<int>(i));
}
std::multiset<int> int_mset;
for (std::size_t i = 0; i != NumElements; ++i) {
int_mset.insert(static_cast<int>(i));
}
typedef std::less<int> comp_int_t;
typedef std::allocator<int> alloc_int_t;
//range
{
auto fset = flat_set(int_set.begin(), int_set.end());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(int_mset.begin(), int_mset.end());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp
{
auto fset = flat_set(int_set.begin(), int_set.end(), comp_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(int_mset.begin(), int_mset.end(), comp_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp+alloc
{
auto fset = flat_set(int_set.begin(), int_set.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(int_mset.begin(), int_mset.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+alloc
{
auto fset = flat_set(int_set.begin(), int_set.end(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(int_mset.begin(), int_mset.end(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//ordered_unique_range / ordered_range
//range
{
auto fset = flat_set(ordered_unique_range, int_set.begin(), int_set.end());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(ordered_range, int_mset.begin(), int_mset.end());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp
{
auto fset = flat_set(ordered_unique_range, int_set.begin(), int_set.end(), comp_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(ordered_range, int_mset.begin(), int_mset.end(), comp_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp+alloc
{
auto fset = flat_set(ordered_unique_range, int_set.begin(), int_set.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(ordered_range, int_mset.begin(), int_mset.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+alloc
{
auto fset = flat_set(ordered_unique_range, int_set.begin(), int_set.end(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = flat_multiset(ordered_range, int_mset.begin(), int_mset.end(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
}
#endif
return true;
}
template< class RandomIt >
void random_shuffle( RandomIt first, RandomIt last )
{
@@ -594,6 +694,13 @@ int main()
return 1;
}
////////////////////////////////////
// Constructor Template Auto Deduction test
////////////////////////////////////
if (!constructor_template_auto_deduction_test()) {
return 1;
}
////////////////////////////////////
// Extract/Adopt test
////////////////////////////////////
@@ -706,30 +813,6 @@ int main()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::set({ 1, 2, 3 });
auto test = boost::container::flat_set(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::flat_set(ordered_unique_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multiset({ 1, 2, 3 });
auto test = boost::container::flat_multiset(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::flat_multiset(ordered_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
return 0;
}

View File

@@ -214,7 +214,7 @@ int main ()
}
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
////////////////////////////////////
// Constructor Template Auto Deduction Tests
////////////////////////////////////

View File

@@ -337,6 +337,106 @@ bool test_heterogeneous_lookups()
return true;
}
bool constructor_template_auto_deduction_test()
{
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
using namespace boost::container;
const std::size_t NumElements = 100;
{
std::map<int, int> int_map;
for(std::size_t i = 0; i != NumElements; ++i){
int_map.insert(std::map<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
std::multimap<int, int> int_mmap;
for (std::size_t i = 0; i != NumElements; ++i) {
int_mmap.insert(std::multimap<int, int>::value_type(static_cast<int>(i), static_cast<int>(i)));
}
typedef std::less<int> comp_int_t;
typedef std::allocator<std::pair<const int, int> > alloc_pair_int_t;
//range
{
auto fmap = map(int_map.begin(), int_map.end());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(int_mmap.begin(), int_mmap.end());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp
{
auto fmap = map(int_map.begin(), int_map.end(), comp_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(int_mmap.begin(), int_mmap.end(), comp_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp+alloc
{
auto fmap = map(int_map.begin(), int_map.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(int_mmap.begin(), int_mmap.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+alloc
{
auto fmap = map(int_map.begin(), int_map.end(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(int_mmap.begin(), int_mmap.end(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//ordered_unique_range / ordered_range
//range
{
auto fmap = map(ordered_unique_range, int_map.begin(), int_map.end());
if(!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(ordered_range, int_mmap.begin(), int_mmap.end());
if(!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp
{
auto fmap = map(ordered_unique_range, int_map.begin(), int_map.end(), comp_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(ordered_range, int_mmap.begin(), int_mmap.end(), comp_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+comp+alloc
{
auto fmap = map(ordered_unique_range, int_map.begin(), int_map.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(ordered_range, int_mmap.begin(), int_mmap.end(), comp_int_t(), alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
//range+alloc
{
auto fmap = map(ordered_unique_range, int_map.begin(), int_map.end(),alloc_pair_int_t());
if (!CheckEqualContainers(int_map, fmap))
return false;
auto fmmap = multimap(ordered_range, int_mmap.begin(), int_mmap.end(),alloc_pair_int_t());
if (!CheckEqualContainers(int_mmap, fmmap))
return false;
}
}
#endif
return true;
}
}}} //namespace boost::container::test
int main ()
@@ -474,30 +574,19 @@ int main ()
}
}
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::map<int, int>({ {1,1}, {2,2}, {3,3} } );
auto test = boost::container::map(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multimap<int, int>({ {1,1}, {2,2}, {3,3} } );
auto test = boost::container::multimap(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
////////////////////////////////////
// Node extraction/insertion testing functions
////////////////////////////////////
if(!node_type_test())
return 1;
////////////////////////////////////
// Constructor Template Auto Deduction test
////////////////////////////////////
if (!test::constructor_template_auto_deduction_test()) {
return 1;
}
if (!boost::container::test::instantiate_constructors<map<int, int>, multimap<int, int> >())
return 1;

View File

@@ -352,7 +352,7 @@ void test_do_allocate()
BOOST_TEST(dmbr.remaining_storage(1u) == sizeof(buf));
//Allocate all remaining storage
dmbr.do_allocate(dmbr.remaining_storage(1u), 1u);
//No new allocation should have ocurred
//No new allocation should have occurred
BOOST_TEST(mrl.m_info.size() == 0u);
BOOST_TEST(dmbr.remaining_storage(1u) == 0u);
}
@@ -433,7 +433,7 @@ void test_release()
//Allocate all remaining storage
mr.allocate(monr.remaining_storage(1u), 1u);
BOOST_TEST(monr.current_buffer() == ((char*)&buf + sizeof(buf)));
//No new allocation should have ocurred
//No new allocation should have occurred
BOOST_TEST(monr.remaining_storage(1u) == 0u);
//Release and check memory was released and the original buffer is back
monr.release();

View File

@@ -206,6 +206,104 @@ struct alloc_propagate_base<boost_container_multiset>
};
};
bool constructor_template_auto_deduction_test()
{
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
using namespace boost::container;
const std::size_t NumElements = 100;
{
std::set<int> int_set;
for (std::size_t i = 0; i != NumElements; ++i) {
int_set.insert(static_cast<int>(i));
}
std::multiset<int> int_mset;
for (std::size_t i = 0; i != NumElements; ++i) {
int_mset.insert(static_cast<int>(i));
}
typedef std::less<int> comp_int_t;
typedef std::allocator<int> alloc_int_t;
//range
{
auto fset = set(int_set.begin(), int_set.end());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(int_mset.begin(), int_mset.end());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp
{
auto fset = set(int_set.begin(), int_set.end(), comp_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(int_mset.begin(), int_mset.end(), comp_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp+alloc
{
auto fset = set(int_set.begin(), int_set.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(int_mset.begin(), int_mset.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+alloc
{
auto fset = set(int_set.begin(), int_set.end(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(int_mset.begin(), int_mset.end(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//ordered_unique_range / ordered_range
//range
{
auto fset = set(ordered_unique_range, int_set.begin(), int_set.end());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(ordered_range, int_mset.begin(), int_mset.end());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp
{
auto fset = set(ordered_unique_range, int_set.begin(), int_set.end(), comp_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(ordered_range, int_mset.begin(), int_mset.end(), comp_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+comp+alloc
{
auto fset = set(ordered_unique_range, int_set.begin(), int_set.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(ordered_range, int_mset.begin(), int_mset.end(), comp_int_t(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
//range+alloc
{
auto fset = set(ordered_unique_range, int_set.begin(), int_set.end(), alloc_int_t());
if (!CheckEqualContainers(int_set, fset))
return false;
auto fmset = multiset(ordered_range, int_mset.begin(), int_mset.end(), alloc_int_t());
if (!CheckEqualContainers(int_mset, fmset))
return false;
}
}
#endif
return true;
}
}}} //boost::container::test
template<class VoidAllocator, boost::container::tree_type_enum tree_type_value>
@@ -360,6 +458,13 @@ int main ()
test_merge_from_different_comparison();
////////////////////////////////////
// Constructor Template Auto Deduction test
////////////////////////////////////
if (!test::constructor_template_auto_deduction_test()) {
return 1;
}
if(!test_heterogeneous_lookups())
return 1;
@@ -500,30 +605,6 @@ int main ()
if(!node_type_test())
return 1;
#if __cplusplus >= 201703L
////////////////////////////////////
// Constructor Template Auto Deduction
////////////////////////////////////
{
auto gold = std::set({ 1, 2, 3 });
auto test = boost::container::set(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::set(ordered_unique_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
{
auto gold = std::multiset({ 1, 2, 3 });
auto test = boost::container::multiset(gold.begin(), gold.end());
if (test.size() != 3)
return 1;
test = boost::container::multiset(ordered_range, gold.begin(), gold.end());
if (test.size() != 3)
return 1;
}
#endif
return 0;
}

View File

@@ -217,7 +217,7 @@ int main ()
return 1;
}
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
////////////////////////////////////
// Constructor Template Auto Deduction Tests
////////////////////////////////////

View File

@@ -177,7 +177,7 @@ int main()
}
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
////////////////////////////////////
// Constructor Template Auto Deduction testing
////////////////////////////////////

View File

@@ -456,7 +456,7 @@ int string_test()
return 1;
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
//Chect Constructor Template Auto Deduction
{
auto gold = StdString(string_literals<CharType>::String());

View File

@@ -56,6 +56,29 @@ int test_expand_bwd()
return 0;
}
struct X;
template<typename T>
struct XRef
{
explicit XRef(T* ptr) : ptr(ptr) {}
operator T*() const { return ptr; }
T* ptr;
};
struct X
{
XRef<X const> operator&() const { return XRef<X const>(this); }
XRef<X> operator&() { return XRef<X>(this); }
};
bool test_smart_ref_type()
{
boost::container::vector<X> x(5);
return x.empty();
}
class recursive_vector
{
public:
@@ -184,6 +207,9 @@ int main()
v.push_back(Test());
}
if (test_smart_ref_type())
return 1;
////////////////////////////////////
// Backwards expansion test
////////////////////////////////////
@@ -234,7 +260,7 @@ int main()
}
}
#if __cplusplus >= 201703L
#ifndef BOOST_CONTAINER_NO_CXX17_CTAD
////////////////////////////////////
// Constructor Template Auto Deduction testing
////////////////////////////////////