forked from boostorg/unordered
Stop using BOOST_DEDUCED_TYPENAME
We no longer support any of the compilers that require it. I'd be very surprised if anything was working on them.
This commit is contained in:
@@ -27,8 +27,8 @@ namespace assign_tests {
|
||||
|
||||
template <class T> void assign_tests1(T*, test::random_generator generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf;
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq;
|
||||
typename T::hasher hf;
|
||||
typename T::key_equal eq;
|
||||
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests1.1\n";
|
||||
{
|
||||
@@ -68,14 +68,14 @@ namespace assign_tests {
|
||||
|
||||
template <class T> void assign_tests2(T*, test::random_generator generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf2(2);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq2(2);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
typename T::hasher hf1(1);
|
||||
typename T::hasher hf2(2);
|
||||
typename T::key_equal eq1(1);
|
||||
typename T::key_equal eq2(2);
|
||||
typename T::allocator_type al1(1);
|
||||
typename T::allocator_type al2(2);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type;
|
||||
typedef typename T::allocator_type allocator_type;
|
||||
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.0 - empty container\n";
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace bucket_tests {
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
typedef typename X::size_type size_type;
|
||||
typedef typename X::const_local_iterator const_local_iterator;
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
X x(v.begin(), v.end());
|
||||
@@ -41,9 +41,8 @@ namespace bucket_tests {
|
||||
<< "<=" << x.max_bucket_count() << "\n";
|
||||
}
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator
|
||||
it = v.begin(),
|
||||
end = v.end();
|
||||
for (typename test::random_values<X>::const_iterator it = v.begin(),
|
||||
end = v.end();
|
||||
it != end; ++it) {
|
||||
size_type bucket = x.bucket(test::get_key<X>(*it));
|
||||
|
||||
|
||||
+139
-161
@@ -52,27 +52,27 @@ template <class T> int implicit_construct()
|
||||
|
||||
template <class X, class T> void container_test(X& r, T const&)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::difference_type difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::difference_type difference_type;
|
||||
typedef typename X::size_type size_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::value_type
|
||||
iterator_value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
std::iterator_traits<const_iterator>::value_type const_iterator_value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::difference_type
|
||||
typedef
|
||||
typename std::iterator_traits<iterator>::value_type iterator_value_type;
|
||||
typedef typename std::iterator_traits<const_iterator>::value_type
|
||||
const_iterator_value_type;
|
||||
typedef typename std::iterator_traits<iterator>::difference_type
|
||||
iterator_difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_iterator>::difference_type const_iterator_difference_type;
|
||||
typedef typename std::iterator_traits<const_iterator>::difference_type
|
||||
const_iterator_difference_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::reference reference;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_reference const_reference;
|
||||
typedef typename X::value_type value_type;
|
||||
typedef typename X::reference reference;
|
||||
typedef typename X::const_reference const_reference;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::node_type node_type;
|
||||
typedef typename X::node_type node_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
|
||||
// value_type
|
||||
|
||||
@@ -97,8 +97,8 @@ template <class X, class T> void container_test(X& r, T const&)
|
||||
|
||||
// node_type
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<allocator_type,
|
||||
BOOST_DEDUCED_TYPENAME node_type::allocator_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<allocator_type, typename node_type::allocator_type>::value));
|
||||
|
||||
// difference_type
|
||||
|
||||
@@ -208,9 +208,9 @@ template <class X, class T> void container_test(X& r, T const&)
|
||||
|
||||
template <class X> void unordered_destructible_test(X&)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::size_type size_type;
|
||||
|
||||
X x1;
|
||||
|
||||
@@ -247,31 +247,30 @@ template <class X> void unordered_destructible_test(X&)
|
||||
|
||||
// Allocator
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
test::check_return_type<allocator_type>::equals(a_const.get_allocator());
|
||||
}
|
||||
|
||||
template <class X, class Key> void unordered_set_test(X& r, Key const&)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
|
||||
typedef typename X::value_type value_type;
|
||||
typedef typename X::key_type key_type;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type, key_type>::value));
|
||||
|
||||
// iterator pointer / const_pointer_type
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::pointer
|
||||
iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<const_iterator>::pointer
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::local_iterator local_iterator;
|
||||
typedef typename X::const_local_iterator const_local_iterator;
|
||||
typedef typename std::iterator_traits<iterator>::pointer iterator_pointer;
|
||||
typedef typename std::iterator_traits<const_iterator>::pointer
|
||||
const_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<local_iterator>::pointer
|
||||
typedef typename std::iterator_traits<local_iterator>::pointer
|
||||
local_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::pointer const_local_iterator_pointer;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::pointer
|
||||
const_local_iterator_pointer;
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<value_type const*, iterator_pointer>::value));
|
||||
@@ -285,52 +284,43 @@ template <class X, class Key> void unordered_set_test(X& r, Key const&)
|
||||
// pointer_traits<iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<iterator,
|
||||
BOOST_DEDUCED_TYPENAME boost::pointer_traits<iterator>::pointer>::value));
|
||||
typename boost::pointer_traits<iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<const_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<const_iterator, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
const_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<const_iterator,
|
||||
typename boost::pointer_traits<const_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
const_iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<const_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<const_iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<local_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<local_iterator, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<local_iterator,
|
||||
typename boost::pointer_traits<local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<local_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
local_iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<local_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<local_iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<const_local_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::pointer>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::element_type>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::element_type>::
|
||||
value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::difference_type>::
|
||||
value));
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME node_type::value_type node_value_type;
|
||||
typedef typename X::node_type node_type;
|
||||
typedef typename node_type::value_type node_value_type;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type, node_value_type>::value));
|
||||
|
||||
// Call node_type functions.
|
||||
@@ -345,26 +335,25 @@ template <class X, class Key> void unordered_set_test(X& r, Key const&)
|
||||
template <class X, class Key, class T>
|
||||
void unordered_map_test(X& r, Key const& k, T const& v)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
|
||||
typedef typename X::value_type value_type;
|
||||
typedef typename X::key_type key_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<value_type, std::pair<key_type const, T> >::value));
|
||||
|
||||
// iterator pointer / const_pointer_type
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::pointer
|
||||
iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<const_iterator>::pointer
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::local_iterator local_iterator;
|
||||
typedef typename X::const_local_iterator const_local_iterator;
|
||||
typedef typename std::iterator_traits<iterator>::pointer iterator_pointer;
|
||||
typedef typename std::iterator_traits<const_iterator>::pointer
|
||||
const_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<local_iterator>::pointer
|
||||
typedef typename std::iterator_traits<local_iterator>::pointer
|
||||
local_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::pointer const_local_iterator_pointer;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::pointer
|
||||
const_local_iterator_pointer;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type*, iterator_pointer>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
@@ -377,53 +366,44 @@ void unordered_map_test(X& r, Key const& k, T const& v)
|
||||
// pointer_traits<iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<iterator,
|
||||
BOOST_DEDUCED_TYPENAME boost::pointer_traits<iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<value_type, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type,
|
||||
typename boost::pointer_traits<iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<const_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<const_iterator, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
const_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<const_iterator,
|
||||
typename boost::pointer_traits<const_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
const_iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<const_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<const_iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<local_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<local_iterator, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<value_type, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
local_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<std::ptrdiff_t, BOOST_DEDUCED_TYPENAME boost::pointer_traits<
|
||||
local_iterator>::difference_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<local_iterator,
|
||||
typename boost::pointer_traits<local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type,
|
||||
typename boost::pointer_traits<local_iterator>::element_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
typename boost::pointer_traits<local_iterator>::difference_type>::value));
|
||||
|
||||
// pointer_traits<const_local_iterator>
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::pointer>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::pointer>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<value_type const,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::element_type>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::element_type>::
|
||||
value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<std::ptrdiff_t,
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::pointer_traits<const_local_iterator>::difference_type>::value));
|
||||
typename boost::pointer_traits<const_local_iterator>::difference_type>::
|
||||
value));
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME node_type::key_type node_key_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME node_type::mapped_type node_mapped_type;
|
||||
typedef typename X::node_type node_type;
|
||||
typedef typename node_type::key_type node_key_type;
|
||||
typedef typename node_type::mapped_type node_mapped_type;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Key, node_key_type>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<T, node_mapped_type>::value));
|
||||
@@ -495,12 +475,12 @@ template <class X> void equality_test(X& r)
|
||||
|
||||
template <class X, class T> void unordered_unique_test(X& r, T const& t)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
test::check_return_type<std::pair<iterator, bool> >::equals(r.insert(t));
|
||||
test::check_return_type<std::pair<iterator, bool> >::equals(r.emplace(t));
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::insert_return_type insert_return_type;
|
||||
typedef typename X::node_type node_type;
|
||||
typedef typename X::insert_return_type insert_return_type;
|
||||
|
||||
// insert_return_type
|
||||
|
||||
@@ -527,7 +507,7 @@ template <class X, class T> void unordered_unique_test(X& r, T const& t)
|
||||
|
||||
template <class X, class T> void unordered_equivalent_test(X& r, T const& t)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
test::check_return_type<iterator>::equals(r.insert(t));
|
||||
test::check_return_type<iterator>::equals(r.emplace(t));
|
||||
}
|
||||
@@ -535,8 +515,8 @@ template <class X, class T> void unordered_equivalent_test(X& r, T const& t)
|
||||
template <class X, class Key, class T>
|
||||
void unordered_map_functions(X&, Key const& k, T const& v)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::mapped_type mapped_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::mapped_type mapped_type;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
X a;
|
||||
test::check_return_type<mapped_type>::equals_ref(a[k]);
|
||||
@@ -567,52 +547,50 @@ void unordered_test(X& x, Key& k, Hash& hf, Pred& eq)
|
||||
{
|
||||
unordered_destructible_test(x);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::hasher hasher;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_equal key_equal;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef typename X::key_type key_type;
|
||||
typedef typename X::hasher hasher;
|
||||
typedef typename X::key_equal key_equal;
|
||||
typedef typename X::size_type size_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::local_iterator local_iterator;
|
||||
typedef typename X::const_local_iterator const_local_iterator;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
std::iterator_traits<iterator>::iterator_category iterator_category;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::difference_type
|
||||
typedef typename std::iterator_traits<iterator>::iterator_category
|
||||
iterator_category;
|
||||
typedef typename std::iterator_traits<iterator>::difference_type
|
||||
iterator_difference;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::pointer
|
||||
iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<iterator>::reference
|
||||
iterator_reference;
|
||||
typedef typename std::iterator_traits<iterator>::pointer iterator_pointer;
|
||||
typedef typename std::iterator_traits<iterator>::reference iterator_reference;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
local_iterator>::iterator_category local_iterator_category;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
local_iterator>::difference_type local_iterator_difference;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<local_iterator>::pointer
|
||||
typedef typename std::iterator_traits<local_iterator>::iterator_category
|
||||
local_iterator_category;
|
||||
typedef typename std::iterator_traits<local_iterator>::difference_type
|
||||
local_iterator_difference;
|
||||
typedef typename std::iterator_traits<local_iterator>::pointer
|
||||
local_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<local_iterator>::reference
|
||||
typedef typename std::iterator_traits<local_iterator>::reference
|
||||
local_iterator_reference;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_iterator>::iterator_category const_iterator_category;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_iterator>::difference_type const_iterator_difference;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<const_iterator>::pointer
|
||||
typedef typename std::iterator_traits<const_iterator>::iterator_category
|
||||
const_iterator_category;
|
||||
typedef typename std::iterator_traits<const_iterator>::difference_type
|
||||
const_iterator_difference;
|
||||
typedef typename std::iterator_traits<const_iterator>::pointer
|
||||
const_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<const_iterator>::reference
|
||||
typedef typename std::iterator_traits<const_iterator>::reference
|
||||
const_iterator_reference;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::iterator_category const_local_iterator_category;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::difference_type const_local_iterator_difference;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::pointer const_local_iterator_pointer;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<
|
||||
const_local_iterator>::reference const_local_iterator_reference;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::iterator_category
|
||||
const_local_iterator_category;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::difference_type
|
||||
const_local_iterator_difference;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::pointer
|
||||
const_local_iterator_pointer;
|
||||
typedef typename std::iterator_traits<const_local_iterator>::reference
|
||||
const_local_iterator_reference;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Key, key_type>::value));
|
||||
// boost::function_requires<boost::CopyConstructibleConcept<key_type> >();
|
||||
@@ -731,15 +709,15 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq)
|
||||
{
|
||||
unordered_test(x, k, hf, eq);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
|
||||
X a;
|
||||
allocator_type m = a.get_allocator();
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::value_type* i = 0;
|
||||
BOOST_DEDUCED_TYPENAME X::value_type* j = 0;
|
||||
typename X::value_type* i = 0;
|
||||
typename X::value_type* j = 0;
|
||||
|
||||
// Constructors
|
||||
|
||||
@@ -829,8 +807,8 @@ void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq)
|
||||
sink(a7a);
|
||||
sink(a9a);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::node_type node_type;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
node_type const n_const = a.extract(a.begin());
|
||||
test::check_return_type<allocator_type>::equals(n_const.get_allocator());
|
||||
}
|
||||
@@ -840,9 +818,9 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
|
||||
{
|
||||
unordered_test(x, k, hf, eq);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
X x1(rvalue_default<X>());
|
||||
|
||||
@@ -25,9 +25,9 @@ namespace constructor_tests {
|
||||
template <class T>
|
||||
void constructor_tests1(T*, test::random_generator generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf;
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq;
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
typename T::hasher hf;
|
||||
typename T::key_equal eq;
|
||||
typename T::allocator_type al;
|
||||
|
||||
UNORDERED_SUB_TEST("Construct 1")
|
||||
{
|
||||
@@ -176,15 +176,15 @@ namespace constructor_tests {
|
||||
template <class T>
|
||||
void constructor_tests2(T*, test::random_generator const& generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf;
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf2(2);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq;
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq2(2);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
typename T::hasher hf;
|
||||
typename T::hasher hf1(1);
|
||||
typename T::hasher hf2(2);
|
||||
typename T::key_equal eq;
|
||||
typename T::key_equal eq1(1);
|
||||
typename T::key_equal eq2(2);
|
||||
typename T::allocator_type al;
|
||||
typename T::allocator_type al1(1);
|
||||
typename T::allocator_type al2(2);
|
||||
|
||||
UNORDERED_SUB_TEST("Construct 1")
|
||||
{
|
||||
@@ -274,14 +274,11 @@ namespace constructor_tests {
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator v_begin =
|
||||
v.begin(),
|
||||
v_end =
|
||||
v.end();
|
||||
typename test::random_values<T>::const_iterator v_begin = v.begin(),
|
||||
v_end = v.end();
|
||||
T x(test::input_iterator(v_begin), test::input_iterator(v_end), 0, hf1,
|
||||
eq1);
|
||||
BOOST_DEDUCED_TYPENAME T::const_iterator x_begin = x.begin(),
|
||||
x_end = x.end();
|
||||
typename T::const_iterator x_begin = x.begin(), x_end = x.end();
|
||||
T y(test::input_iterator(x_begin), test::input_iterator(x_end), 0, hf2,
|
||||
eq2);
|
||||
test::check_container(x, v);
|
||||
@@ -320,7 +317,7 @@ namespace constructor_tests {
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
std::initializer_list<BOOST_DEDUCED_TYPENAME T::value_type> list;
|
||||
std::initializer_list<typename T::value_type> list;
|
||||
|
||||
UNORDERED_SUB_TEST("Initializer list construct 1")
|
||||
{
|
||||
@@ -386,8 +383,8 @@ namespace constructor_tests {
|
||||
template <class T>
|
||||
void map_constructor_test(T*, test::random_generator const& generator)
|
||||
{
|
||||
typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME T::key_type,
|
||||
BOOST_DEDUCED_TYPENAME T::mapped_type> >
|
||||
typedef test::list<
|
||||
std::pair<typename T::key_type, typename T::mapped_type> >
|
||||
list;
|
||||
test::random_values<T> v(1000, generator);
|
||||
list l(v.begin(), v.end());
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace copy_tests {
|
||||
template <class T>
|
||||
void copy_construct_tests1(T*, test::random_generator const& generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type;
|
||||
typedef typename T::allocator_type allocator_type;
|
||||
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf;
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq;
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
typename T::hasher hf;
|
||||
typename T::key_equal eq;
|
||||
typename T::allocator_type al;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
@@ -84,12 +84,12 @@ namespace copy_tests {
|
||||
template <class T>
|
||||
void copy_construct_tests2(T*, test::random_generator const& generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
typename T::hasher hf(1);
|
||||
typename T::key_equal eq(1);
|
||||
typename T::allocator_type al(1);
|
||||
typename T::allocator_type al2(2);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type;
|
||||
typedef typename T::allocator_type allocator_type;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace erase_tests {
|
||||
template <class Container>
|
||||
void erase_tests1(Container*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Container::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container::const_iterator c_iterator;
|
||||
typedef typename Container::iterator iterator;
|
||||
typedef typename Container::const_iterator c_iterator;
|
||||
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Erase by key.\n";
|
||||
{
|
||||
@@ -37,8 +37,7 @@ namespace erase_tests {
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
int iterations = 0;
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<Container>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<Container>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
std::size_t count = x.count(test::get_key<Container>(*it));
|
||||
std::size_t old_size = x.size();
|
||||
@@ -60,8 +59,7 @@ namespace erase_tests {
|
||||
std::size_t size = x.size();
|
||||
int iterations = 0;
|
||||
while (size > 0 && !x.empty()) {
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*x.begin());
|
||||
typename Container::key_type key = test::get_key<Container>(*x.begin());
|
||||
std::size_t count = x.count(key);
|
||||
iterator pos = x.erase(x.begin());
|
||||
--size;
|
||||
@@ -92,8 +90,7 @@ namespace erase_tests {
|
||||
pos = test::next(prev);
|
||||
}
|
||||
next = test::next(pos);
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*pos);
|
||||
typename Container::key_type key = test::get_key<Container>(*pos);
|
||||
std::size_t count = x.count(key);
|
||||
BOOST_TEST(count > 0);
|
||||
BOOST_TEST(next == x.erase(pos));
|
||||
@@ -163,7 +160,7 @@ namespace erase_tests {
|
||||
test::next(iterators.begin(), start + length));
|
||||
|
||||
BOOST_TEST(x.size() == iterators.size() - 1);
|
||||
BOOST_DEDUCED_TYPENAME std::vector<c_iterator>::const_iterator i2 =
|
||||
typename std::vector<c_iterator>::const_iterator i2 =
|
||||
iterators.begin();
|
||||
for (c_iterator i1 = x.cbegin(); i1 != x.cend(); ++i1) {
|
||||
BOOST_TEST(i1 == *i2);
|
||||
@@ -186,8 +183,7 @@ namespace erase_tests {
|
||||
std::size_t size = x.size();
|
||||
int iterations = 0;
|
||||
while (size > 0 && !x.empty()) {
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*x.begin());
|
||||
typename Container::key_type key = test::get_key<Container>(*x.begin());
|
||||
std::size_t count = x.count(key);
|
||||
x.quick_erase(x.begin());
|
||||
--size;
|
||||
@@ -209,7 +205,7 @@ namespace erase_tests {
|
||||
int iterations = 0;
|
||||
while (size > 0 && !x.empty()) {
|
||||
std::size_t index = test::random_value(x.size());
|
||||
BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next;
|
||||
typename Container::const_iterator prev, pos, next;
|
||||
if (index == 0) {
|
||||
prev = pos = x.begin();
|
||||
} else {
|
||||
@@ -217,8 +213,7 @@ namespace erase_tests {
|
||||
pos = test::next(prev);
|
||||
}
|
||||
next = test::next(pos);
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*pos);
|
||||
typename Container::key_type key = test::get_key<Container>(*pos);
|
||||
std::size_t count = x.count(key);
|
||||
BOOST_TEST(count > 0);
|
||||
x.quick_erase(pos);
|
||||
|
||||
@@ -32,8 +32,7 @@ namespace extract_tests {
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
int iterations = 0;
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<Container>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<Container>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
std::size_t count = x.count(test::get_key<Container>(*it));
|
||||
std::size_t old_size = x.size();
|
||||
@@ -64,8 +63,7 @@ namespace extract_tests {
|
||||
std::size_t size = x.size();
|
||||
int iterations = 0;
|
||||
while (size > 0 && !x.empty()) {
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*x.begin());
|
||||
typename Container::key_type key = test::get_key<Container>(*x.begin());
|
||||
std::size_t count = x.count(key);
|
||||
typename Container::node_type n = x.extract(x.begin());
|
||||
BOOST_TEST(n);
|
||||
@@ -89,7 +87,7 @@ namespace extract_tests {
|
||||
while (size > 0 && !x.empty()) {
|
||||
using namespace std;
|
||||
int index = rand() % (int)x.size();
|
||||
BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next;
|
||||
typename Container::const_iterator prev, pos, next;
|
||||
if (index == 0) {
|
||||
prev = pos = x.begin();
|
||||
} else {
|
||||
@@ -97,8 +95,7 @@ namespace extract_tests {
|
||||
pos = test::next(prev);
|
||||
}
|
||||
next = test::next(pos);
|
||||
BOOST_DEDUCED_TYPENAME Container::key_type key =
|
||||
test::get_key<Container>(*pos);
|
||||
typename Container::key_type key = test::get_key<Container>(*pos);
|
||||
std::size_t count = x.count(key);
|
||||
typename Container::node_type n = x.extract(pos);
|
||||
BOOST_TEST(n);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace find_tests {
|
||||
|
||||
template <class X> void find_tests1(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
@@ -33,11 +33,10 @@ namespace find_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
tracker.insert_range(v.begin(), v.end());
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::ordered<X>::const_iterator it1 =
|
||||
tracker.begin();
|
||||
for (typename test::ordered<X>::const_iterator it1 = tracker.begin();
|
||||
it1 != tracker.end(); ++it1) {
|
||||
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it1);
|
||||
BOOST_DEDUCED_TYPENAME X::const_iterator const_pos = x_const.find(key);
|
||||
typename X::key_type key = test::get_key<X>(*it1);
|
||||
typename X::const_iterator const_pos = x_const.find(key);
|
||||
iterator pos = x.find(key);
|
||||
BOOST_TEST(const_pos != x_const.end());
|
||||
BOOST_TEST(const_pos != x_const.end() &&
|
||||
@@ -48,16 +47,15 @@ namespace find_tests {
|
||||
BOOST_TEST(x.count(key) == tracker.count(key));
|
||||
|
||||
test::compare_pairs(x.equal_range(key), tracker.equal_range(key),
|
||||
(BOOST_DEDUCED_TYPENAME X::value_type*)0);
|
||||
(typename X::value_type*)0);
|
||||
test::compare_pairs(x_const.equal_range(key), tracker.equal_range(key),
|
||||
(BOOST_DEDUCED_TYPENAME X::value_type*)0);
|
||||
(typename X::value_type*)0);
|
||||
}
|
||||
|
||||
test::random_values<X> v2(500, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator it2 =
|
||||
v2.begin();
|
||||
for (typename test::random_values<X>::const_iterator it2 = v2.begin();
|
||||
it2 != v2.end(); ++it2) {
|
||||
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it2);
|
||||
typename X::key_type key = test::get_key<X>(*it2);
|
||||
if (tracker.find(test::get_key<X>(key)) == tracker.end()) {
|
||||
BOOST_TEST(x.find(key) == x.end());
|
||||
BOOST_TEST(x_const.find(key) == x_const.end());
|
||||
@@ -74,10 +72,9 @@ namespace find_tests {
|
||||
X x;
|
||||
|
||||
test::random_values<X> v2(5, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator it3 =
|
||||
v2.begin();
|
||||
for (typename test::random_values<X>::const_iterator it3 = v2.begin();
|
||||
it3 != v2.end(); ++it3) {
|
||||
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it3);
|
||||
typename X::key_type key = test::get_key<X>(*it3);
|
||||
BOOST_TEST(x.find(key) == x.end());
|
||||
BOOST_TEST(x.count(key) == 0);
|
||||
std::pair<iterator, iterator> range = x.equal_range(key);
|
||||
@@ -116,8 +113,7 @@ namespace find_tests {
|
||||
template <class X>
|
||||
void find_compatible_keys_test(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
|
||||
value_iterator;
|
||||
typedef typename test::random_values<X>::iterator value_iterator;
|
||||
test::random_values<X> v(500, generator);
|
||||
X x(v.begin(), v.end());
|
||||
|
||||
@@ -125,14 +121,14 @@ namespace find_tests {
|
||||
compatible_predicate eq;
|
||||
|
||||
for (value_iterator it = v.begin(), end = v.end(); it != end; ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it);
|
||||
typename X::key_type key = test::get_key<X>(*it);
|
||||
BOOST_TEST(x.find(key) == x.find(compatible_key(key), h, eq));
|
||||
}
|
||||
|
||||
test::random_values<X> v2(20, generator);
|
||||
|
||||
for (value_iterator it = v2.begin(), end = v2.end(); it != end; ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it);
|
||||
typename X::key_type key = test::get_key<X>(*it);
|
||||
BOOST_TEST(x.find(key) == x.find(compatible_key(key), h, eq));
|
||||
}
|
||||
}
|
||||
|
||||
+73
-100
@@ -30,7 +30,7 @@ namespace insert_tests {
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef test::ordered<X> ordered;
|
||||
|
||||
UNORDERED_SUB_TEST("insert(value) tests for containers with unique keys")
|
||||
@@ -40,16 +40,14 @@ namespace insert_tests {
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
std::pair<iterator, bool> r1 = x.insert(*it);
|
||||
std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 =
|
||||
tracker.insert(*it);
|
||||
std::pair<typename ordered::iterator, bool> r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(r1.second == r2.second);
|
||||
BOOST_TEST(*r1.first == *r2.first);
|
||||
@@ -71,17 +69,15 @@ namespace insert_tests {
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
typename X::value_type value = *it;
|
||||
std::pair<iterator, bool> r1 = x.insert(boost::move(value));
|
||||
std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 =
|
||||
tracker.insert(*it);
|
||||
std::pair<typename ordered::iterator, bool> r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(r1.second == r2.second);
|
||||
BOOST_TEST(*r1.first == *r2.first);
|
||||
@@ -109,15 +105,13 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(*it);
|
||||
BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 =
|
||||
tracker.insert(*it);
|
||||
typename X::iterator r1 = x.insert(*it);
|
||||
typename test::ordered<X>::iterator r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(*r1 == *r2);
|
||||
|
||||
@@ -138,16 +132,14 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
typename X::value_type value = *it;
|
||||
BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(boost::move(value));
|
||||
BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 =
|
||||
tracker.insert(*it);
|
||||
typename X::iterator r1 = x.insert(boost::move(value));
|
||||
typename test::ordered<X>::iterator r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(*r1 == *r2);
|
||||
|
||||
@@ -164,10 +156,10 @@ namespace insert_tests {
|
||||
|
||||
template <class X> void insert_tests2(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME test::ordered<X> tracker_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME tracker_type::iterator tracker_iterator;
|
||||
typedef typename test::ordered<X> tracker_type;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef typename X::const_iterator const_iterator;
|
||||
typedef typename tracker_type::iterator tracker_iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("insert(begin(), value) tests")
|
||||
{
|
||||
@@ -177,10 +169,9 @@ namespace insert_tests {
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator r1 = x.insert(x.begin(), *it);
|
||||
@@ -206,10 +197,9 @@ namespace insert_tests {
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(100, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
const_iterator r1 = x.insert(x_const.end(), *it);
|
||||
@@ -235,10 +225,9 @@ namespace insert_tests {
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
pos = x.insert(pos, *it);
|
||||
@@ -264,10 +253,9 @@ namespace insert_tests {
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
typename X::value_type value = *it;
|
||||
@@ -293,10 +281,9 @@ namespace insert_tests {
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
x.insert(it, test::next(it));
|
||||
@@ -349,10 +336,8 @@ namespace insert_tests {
|
||||
X x;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator begin =
|
||||
v.begin(),
|
||||
end =
|
||||
v.end();
|
||||
typename test::random_values<X>::const_iterator begin = v.begin(),
|
||||
end = v.end();
|
||||
x.insert(test::input_iterator(begin), test::input_iterator(end));
|
||||
test::check_container(x, v);
|
||||
|
||||
@@ -394,14 +379,12 @@ namespace insert_tests {
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end();) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count =
|
||||
x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator next = it;
|
||||
typename test::random_values<X>::iterator next = it;
|
||||
for (std::size_t j = test::random_value(20); j > 0; ++j) {
|
||||
++next;
|
||||
if (next == v.end()) {
|
||||
@@ -428,7 +411,7 @@ namespace insert_tests {
|
||||
template <class X>
|
||||
void unique_emplace_tests1(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
typedef test::ordered<X> ordered;
|
||||
|
||||
X x;
|
||||
@@ -436,15 +419,14 @@ namespace insert_tests {
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
std::pair<iterator, bool> r1 = x.emplace(*it);
|
||||
std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 =
|
||||
tracker.insert(*it);
|
||||
std::pair<typename ordered::iterator, bool> r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(r1.second == r2.second);
|
||||
BOOST_TEST(*r1.first == *r2.first);
|
||||
@@ -467,14 +449,13 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::iterator r1 = x.emplace(*it);
|
||||
BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 =
|
||||
tracker.insert(*it);
|
||||
typename X::iterator r1 = x.emplace(*it);
|
||||
typename test::ordered<X>::iterator r2 = tracker.insert(*it);
|
||||
|
||||
BOOST_TEST(*r1 == *r2);
|
||||
|
||||
@@ -497,10 +478,10 @@ namespace insert_tests {
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
typename X::value_type value = *it;
|
||||
@@ -558,9 +539,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
x[it->first] = it->second;
|
||||
@@ -579,7 +560,7 @@ namespace insert_tests {
|
||||
|
||||
template <class X> void map_tests2(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("insert_or_assign")
|
||||
{
|
||||
@@ -589,10 +570,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
std::pair<iterator, bool> r = x.insert_or_assign(it->first, it->second);
|
||||
@@ -618,10 +598,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator r = x.insert_or_assign(x.begin(), it->first, it->second);
|
||||
@@ -647,10 +626,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator r = x.insert_or_assign(x.end(), it->first, it->second);
|
||||
@@ -677,10 +655,9 @@ namespace insert_tests {
|
||||
iterator last = x.begin();
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator r = x.insert_or_assign(last, it->first, it->second);
|
||||
@@ -704,7 +681,7 @@ namespace insert_tests {
|
||||
template <class X>
|
||||
void try_emplace_tests(X*, test::random_generator generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("try_emplace(key, value)")
|
||||
{
|
||||
@@ -714,10 +691,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator pos = x.find(it->first);
|
||||
@@ -745,7 +721,7 @@ namespace insert_tests {
|
||||
test::check_equivalent_keys(x);
|
||||
}
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("try_emplace(begin(), key, value)")
|
||||
{
|
||||
@@ -755,10 +731,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator pos = x.find(it->first);
|
||||
@@ -783,7 +758,7 @@ namespace insert_tests {
|
||||
test::check_equivalent_keys(x);
|
||||
}
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("try_emplace(end(), key, value)")
|
||||
{
|
||||
@@ -793,10 +768,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator pos = x.find(it->first);
|
||||
@@ -820,7 +794,7 @@ namespace insert_tests {
|
||||
test::check_equivalent_keys(x);
|
||||
}
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef typename X::iterator iterator;
|
||||
|
||||
UNORDERED_SUB_TEST("try_emplace(pos, key, value)")
|
||||
{
|
||||
@@ -830,10 +804,9 @@ namespace insert_tests {
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it =
|
||||
v.begin();
|
||||
for (typename test::random_values<X>::iterator it = v.begin();
|
||||
it != v.end(); ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_bucket_count = x.bucket_count();
|
||||
float b = x.max_load_factor();
|
||||
|
||||
iterator pos = x.find(it->first);
|
||||
@@ -866,8 +839,8 @@ namespace insert_tests {
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type,
|
||||
BOOST_DEDUCED_TYPENAME X::mapped_type> >
|
||||
typedef test::list<
|
||||
std::pair<typename X::key_type, typename X::mapped_type> >
|
||||
list;
|
||||
test::random_values<X> v(1000, generator);
|
||||
list l(v.begin(), v.end());
|
||||
@@ -883,11 +856,11 @@ namespace insert_tests {
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type const,
|
||||
test::implicitly_convertible> >
|
||||
typedef test::list<
|
||||
std::pair<typename X::key_type const, test::implicitly_convertible> >
|
||||
list;
|
||||
test::random_values<boost::unordered_map<BOOST_DEDUCED_TYPENAME X::key_type,
|
||||
test::implicitly_convertible> >
|
||||
test::random_values<
|
||||
boost::unordered_map<typename X::key_type, test::implicitly_convertible> >
|
||||
v(1000, generator);
|
||||
list l(v.begin(), v.end());
|
||||
|
||||
|
||||
@@ -47,12 +47,11 @@ namespace load_factor_tests {
|
||||
|
||||
test::random_values<X> values(1000, generator);
|
||||
|
||||
for (BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator
|
||||
it = values.begin(),
|
||||
end = values.end();
|
||||
for (typename test::random_values<X>::const_iterator it = values.begin(),
|
||||
end = values.end();
|
||||
it != end; ++it) {
|
||||
BOOST_DEDUCED_TYPENAME X::size_type old_size = x.size(),
|
||||
old_bucket_count = x.bucket_count();
|
||||
typename X::size_type old_size = x.size(),
|
||||
old_bucket_count = x.bucket_count();
|
||||
x.insert(*it);
|
||||
if (static_cast<double>(old_size + 1) <=
|
||||
b * static_cast<double>(old_bucket_count))
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace move_tests {
|
||||
|
||||
template <class T>
|
||||
T create(test::random_values<T> const& v, test::object_count& count,
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf, BOOST_DEDUCED_TYPENAME T::key_equal eq,
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al, float mlf)
|
||||
typename T::hasher hf, typename T::key_equal eq,
|
||||
typename T::allocator_type al, float mlf)
|
||||
{
|
||||
T x(0, hf, eq, al);
|
||||
x.max_load_factor(mlf);
|
||||
@@ -56,9 +56,9 @@ namespace move_tests {
|
||||
template <class T>
|
||||
void move_construct_tests1(T* ptr, test::random_generator const& generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf;
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq;
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
typename T::hasher hf;
|
||||
typename T::key_equal eq;
|
||||
typename T::allocator_type al;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
@@ -107,10 +107,10 @@ namespace move_tests {
|
||||
template <class T>
|
||||
void move_construct_tests2(T*, test::random_generator const& generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
typename T::hasher hf(1);
|
||||
typename T::key_equal eq(1);
|
||||
typename T::allocator_type al(1);
|
||||
typename T::allocator_type al2(2);
|
||||
|
||||
test::object_count count;
|
||||
|
||||
@@ -180,11 +180,11 @@ namespace move_tests {
|
||||
template <class T>
|
||||
void move_assign_tests2(T*, test::random_generator const& generator)
|
||||
{
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al1(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type;
|
||||
typename T::hasher hf(1);
|
||||
typename T::key_equal eq(1);
|
||||
typename T::allocator_type al1(1);
|
||||
typename T::allocator_type al2(2);
|
||||
typedef typename T::allocator_type allocator_type;
|
||||
|
||||
{
|
||||
test::random_values<T> v(500, generator);
|
||||
|
||||
@@ -147,24 +147,24 @@ UNORDERED_AUTO_TEST (failed_insertion_with_hint) {
|
||||
|
||||
template <typename NodeHandle>
|
||||
bool node_handle_compare(
|
||||
NodeHandle const& nh, BOOST_DEDUCED_TYPENAME NodeHandle::value_type const& x)
|
||||
NodeHandle const& nh, typename NodeHandle::value_type const& x)
|
||||
{
|
||||
return x == nh.value();
|
||||
}
|
||||
|
||||
template <typename NodeHandle>
|
||||
bool node_handle_compare(NodeHandle const& nh,
|
||||
std::pair<BOOST_DEDUCED_TYPENAME NodeHandle::key_type const,
|
||||
BOOST_DEDUCED_TYPENAME NodeHandle::mapped_type> const& x)
|
||||
bool node_handle_compare(
|
||||
NodeHandle const& nh, std::pair<typename NodeHandle::key_type const,
|
||||
typename NodeHandle::mapped_type> const& x)
|
||||
{
|
||||
return x.first == nh.key() && x.second == nh.mapped();
|
||||
}
|
||||
|
||||
template <typename Container> void node_handle_tests_impl(Container& c)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Container::node_type node_type;
|
||||
typedef typename Container::node_type node_type;
|
||||
|
||||
BOOST_DEDUCED_TYPENAME Container::value_type value = *c.begin();
|
||||
typename Container::value_type value = *c.begin();
|
||||
|
||||
node_type n1;
|
||||
BOOST_TEST(!n1);
|
||||
@@ -195,9 +195,9 @@ template <typename Container> void node_handle_tests_impl(Container& c)
|
||||
n3 = boost::move(n3);
|
||||
BOOST_TEST(!n3);
|
||||
|
||||
BOOST_DEDUCED_TYPENAME Container::value_type value1 = *c.begin();
|
||||
typename Container::value_type value1 = *c.begin();
|
||||
n1 = c.extract(c.begin());
|
||||
BOOST_DEDUCED_TYPENAME Container::value_type value2 = *c.begin();
|
||||
typename Container::value_type value2 = *c.begin();
|
||||
n2 = c.extract(c.begin());
|
||||
n3 = node_type();
|
||||
|
||||
@@ -248,15 +248,13 @@ UNORDERED_AUTO_TEST (node_handle_tests) {
|
||||
template <typename Container1, typename Container2>
|
||||
void insert_node_handle_unique(Container1& c1, Container2& c2)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<node_type,
|
||||
BOOST_DEDUCED_TYPENAME Container2::node_type>::value));
|
||||
typedef typename Container1::node_type node_type;
|
||||
typedef typename Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<node_type, typename Container2::node_type>::value));
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::insert_return_type
|
||||
insert_return_type1;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container2::insert_return_type
|
||||
insert_return_type2;
|
||||
typedef typename Container1::insert_return_type insert_return_type1;
|
||||
typedef typename Container2::insert_return_type insert_return_type2;
|
||||
|
||||
insert_return_type1 r1 = c1.insert(node_type());
|
||||
insert_return_type2 r2 = c2.insert(node_type());
|
||||
@@ -293,15 +291,14 @@ void insert_node_handle_unique(Container1& c1, Container2& c2)
|
||||
template <typename Container1, typename Container2>
|
||||
void insert_node_handle_unique2(Container1& c1, Container2& c2)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<node_type,
|
||||
BOOST_DEDUCED_TYPENAME Container2::node_type>::value));
|
||||
typedef typename Container1::node_type node_type;
|
||||
typedef typename Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<node_type, typename Container2::node_type>::value));
|
||||
|
||||
// typedef BOOST_DEDUCED_TYPENAME Container1::insert_return_type
|
||||
// typedef typename Container1::insert_return_type
|
||||
// insert_return_type1;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container2::insert_return_type
|
||||
insert_return_type2;
|
||||
typedef typename Container2::insert_return_type insert_return_type2;
|
||||
|
||||
while (!c1.empty()) {
|
||||
value_type v = *c1.begin();
|
||||
@@ -327,13 +324,13 @@ void insert_node_handle_unique2(Container1& c1, Container2& c2)
|
||||
template <typename Container1, typename Container2>
|
||||
void insert_node_handle_equiv(Container1& c1, Container2& c2)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<node_type,
|
||||
BOOST_DEDUCED_TYPENAME Container2::node_type>::value));
|
||||
typedef typename Container1::node_type node_type;
|
||||
typedef typename Container1::value_type value_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
(boost::is_same<node_type, typename Container2::node_type>::value));
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME Container1::iterator iterator1;
|
||||
typedef BOOST_DEDUCED_TYPENAME Container2::iterator iterator2;
|
||||
typedef typename Container1::iterator iterator1;
|
||||
typedef typename Container2::iterator iterator2;
|
||||
|
||||
iterator1 r1 = c1.insert(node_type());
|
||||
iterator2 r2 = c2.insert(node_type());
|
||||
|
||||
@@ -20,8 +20,7 @@ namespace rehash_tests {
|
||||
|
||||
test::seed_t initialize_seed(2974);
|
||||
|
||||
template <class X>
|
||||
bool postcondition(X const& x, BOOST_DEDUCED_TYPENAME X::size_type n)
|
||||
template <class X> bool postcondition(X const& x, typename X::size_type n)
|
||||
{
|
||||
return static_cast<double>(x.bucket_count()) >=
|
||||
static_cast<double>(x.size()) / x.max_load_factor() &&
|
||||
|
||||
@@ -73,7 +73,7 @@ template <class X> void simple_test(X const& a)
|
||||
}
|
||||
|
||||
{
|
||||
BOOST_TEST(a.size() == static_cast<BOOST_DEDUCED_TYPENAME X::size_type>(
|
||||
BOOST_TEST(a.size() == static_cast<typename X::size_type>(
|
||||
std::distance(a.begin(), a.end())));
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,9 @@ namespace swap_tests {
|
||||
{
|
||||
swap_tests1(ptr, generator);
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::hasher hasher;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_equal key_equal;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
typedef typename X::hasher hasher;
|
||||
typedef typename X::key_equal key_equal;
|
||||
typedef typename X::allocator_type allocator_type;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace unnecessary_copy_tests {
|
||||
template <class T> void unnecessary_copy_insert_test(T*)
|
||||
{
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
reset();
|
||||
x.insert(a);
|
||||
COPY_COUNT(1);
|
||||
@@ -187,13 +187,13 @@ namespace unnecessary_copy_tests {
|
||||
template <class T> void unnecessary_copy_insert_rvalue_set_test(T*)
|
||||
{
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
reset();
|
||||
x.insert(boost::move(a));
|
||||
COPY_COUNT(0);
|
||||
MOVE_COUNT(1);
|
||||
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a2;
|
||||
typename T::value_type a2;
|
||||
reset();
|
||||
x.insert(boost::move(a));
|
||||
COPY_COUNT(0);
|
||||
@@ -207,7 +207,7 @@ namespace unnecessary_copy_tests {
|
||||
// construct_from_args.
|
||||
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
reset();
|
||||
x.insert(boost::move(a));
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
@@ -218,7 +218,7 @@ namespace unnecessary_copy_tests {
|
||||
MOVE_COUNT(1);
|
||||
#endif
|
||||
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a2;
|
||||
typename T::value_type a2;
|
||||
reset();
|
||||
x.insert(boost::move(a));
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
@@ -243,7 +243,7 @@ namespace unnecessary_copy_tests {
|
||||
{
|
||||
reset();
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
COPY_COUNT(1);
|
||||
x.emplace(a);
|
||||
COPY_COUNT(2);
|
||||
@@ -253,7 +253,7 @@ namespace unnecessary_copy_tests {
|
||||
{
|
||||
reset();
|
||||
T x;
|
||||
x.emplace(source<BOOST_DEDUCED_TYPENAME T::value_type>());
|
||||
x.emplace(source<typename T::value_type>());
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
COPY_COUNT(1);
|
||||
#else
|
||||
@@ -271,7 +271,7 @@ namespace unnecessary_copy_tests {
|
||||
{
|
||||
reset();
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
COPY_COUNT(1);
|
||||
MOVE_COUNT(0);
|
||||
x.emplace(std::move(a));
|
||||
@@ -287,7 +287,7 @@ namespace unnecessary_copy_tests {
|
||||
{
|
||||
reset();
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
COPY_COUNT(1);
|
||||
MOVE_COUNT_EXTRA(0, 1);
|
||||
x.emplace(boost::move(a));
|
||||
@@ -308,7 +308,7 @@ namespace unnecessary_copy_tests {
|
||||
{
|
||||
reset();
|
||||
T x;
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
COPY_COUNT(1);
|
||||
MOVE_COUNT(0);
|
||||
x.emplace(boost::move(a));
|
||||
@@ -325,7 +325,7 @@ namespace unnecessary_copy_tests {
|
||||
T x;
|
||||
COPY_COUNT(0);
|
||||
MOVE_COUNT(0);
|
||||
BOOST_DEDUCED_TYPENAME T::value_type a;
|
||||
typename T::value_type a;
|
||||
COPY_COUNT(1);
|
||||
MOVE_COUNT_EXTRA(0, 1);
|
||||
x.emplace(boost::move(a));
|
||||
|
||||
Reference in New Issue
Block a user