[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -6,7 +6,7 @@
#if !defined(BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD)
#define BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD
#include <boost/detail/lightweight_test.hpp>
#include <boost/core/lightweight_test.hpp>
namespace test {
struct object_count

View File

@@ -10,7 +10,7 @@
#include "./list.hpp"
#include "./metafunctions.hpp"
#include <algorithm>
#include <boost/detail/lightweight_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
@@ -58,12 +58,12 @@ namespace test {
template <class Container> class unordered_equivalence_tester
{
BOOST_DEDUCED_TYPENAME Container::size_type size_;
BOOST_DEDUCED_TYPENAME Container::hasher hasher_;
BOOST_DEDUCED_TYPENAME Container::key_equal key_equal_;
typename Container::size_type size_;
typename Container::hasher hasher_;
typename Container::key_equal key_equal_;
float max_load_factor_;
typedef test::list<BOOST_DEDUCED_TYPENAME Container::value_type> value_list;
typedef test::list<typename Container::value_type> value_list;
value_list values_;
public:

View File

@@ -176,21 +176,18 @@ namespace test {
DISABLE_EXCEPTIONS;
test::check_instances check;
test::scope = "";
BOOST_DEDUCED_TYPENAME Test::data_type x(test_.init());
BOOST_DEDUCED_TYPENAME Test::strong_type strong;
typename Test::data_type x(test_.init());
typename Test::strong_type strong;
strong.store(x);
try {
ENABLE_EXCEPTIONS;
call_ignore_extra_parameters<Test,
BOOST_DEDUCED_TYPENAME Test::data_type,
BOOST_DEDUCED_TYPENAME Test::strong_type>(
&Test::run, test_, x, strong);
call_ignore_extra_parameters<Test, typename Test::data_type,
typename Test::strong_type>(&Test::run, test_, x, strong);
} catch (...) {
try {
DISABLE_EXCEPTIONS;
call_ignore_extra_parameters<Test,
BOOST_DEDUCED_TYPENAME Test::data_type const,
BOOST_DEDUCED_TYPENAME Test::strong_type const>(
call_ignore_extra_parameters<Test, typename Test::data_type const,
typename Test::strong_type const>(
&Test::check, test_, constant(x), constant(strong));
} catch (...) {
exception_in_check_ = true;

View File

@@ -6,10 +6,12 @@
#if !defined(BOOST_UNORDERED_TEST_HELPERS_HEADER)
#define BOOST_UNORDERED_TEST_HELPERS_HEADER
#include <iterator>
namespace test {
template <class Container> struct get_key_impl
{
typedef BOOST_DEDUCED_TYPENAME Container::key_type key_type;
typedef typename Container::key_type key_type;
static key_type const& get_key(key_type const& x) { return x; }
@@ -28,7 +30,7 @@ namespace test {
};
template <class Container, class T>
inline BOOST_DEDUCED_TYPENAME Container::key_type const& get_key(T const& x)
inline typename Container::key_type const& get_key(T const& x)
{
return get_key_impl<Container>::get_key(x);
}
@@ -36,16 +38,17 @@ namespace test {
// test::next
//
// Increments an iterator by 1 or a given value.
// Like boost::next, but simpler and slower.
// Like boost::next, but simpler.
// Mainly because boost::next uses an MPL file
// which causes warnings.
template <typename Iterator> Iterator next(Iterator it) { return ++it; }
template <typename Iterator, typename IntType>
Iterator next(Iterator it, IntType x)
{
for (; x > 0; --x) {
++it;
}
std::advance(it,
static_cast<typename std::iterator_traits<Iterator>::difference_type>(x));
return it;
}
}

View File

@@ -7,13 +7,12 @@
#define BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER
#include <boost/config.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <iterator>
namespace test {
template <class Iterator> struct proxy
{
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type value_type;
typedef typename Iterator::value_type value_type;
explicit proxy(value_type const& v) : v_(v) {}
proxy(proxy const& x) : v_(x.v_) {}
@@ -25,16 +24,13 @@ namespace test {
proxy& operator=(proxy const&);
};
template <class Iterator>
struct input_iterator_adaptor
: public std::iterator<std::input_iterator_tag,
BOOST_DEDUCED_TYPENAME boost::iterator_value<Iterator>::type,
std::ptrdiff_t,
BOOST_DEDUCED_TYPENAME boost::iterator_pointer<Iterator>::type,
proxy<Iterator> >
template <class Iterator> struct input_iterator_adaptor
{
typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<Iterator>::type
value_type;
typedef typename std::iterator_traits<Iterator>::value_type value_type;
typedef typename std::iterator_traits<Iterator>::pointer pointer;
typedef proxy<Iterator> reference;
typedef std::ptrdiff_t difference_type;
typedef std::input_iterator_tag iterator_category;
input_iterator_adaptor() : base_() {}
explicit input_iterator_adaptor(Iterator& it) : base_(&it) {}
@@ -66,19 +62,15 @@ namespace test {
return input_iterator_adaptor<Iterator>(it);
}
template <class Iterator>
struct copy_iterator_adaptor
: public std::iterator<
BOOST_DEDUCED_TYPENAME boost::iterator_category<Iterator>::type,
BOOST_DEDUCED_TYPENAME boost::iterator_value<Iterator>::type,
BOOST_DEDUCED_TYPENAME boost::iterator_difference<Iterator>::type,
BOOST_DEDUCED_TYPENAME boost::iterator_pointer<Iterator>::type,
proxy<Iterator> >
template <class Iterator> struct copy_iterator_adaptor
{
typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<Iterator>::type
value_type;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<Iterator>::type
difference_type;
typedef typename std::iterator_traits<Iterator>::value_type value_type;
typedef
typename std::iterator_traits<Iterator>::difference_type difference_type;
typedef typename std::iterator_traits<Iterator>::iterator_category
iterator_category;
typedef typename std::iterator_traits<Iterator>::pointer pointer;
typedef proxy<Iterator> reference;
copy_iterator_adaptor() : base_() {}
explicit copy_iterator_adaptor(Iterator const& it) : base_(it) {}

View File

@@ -24,12 +24,12 @@
namespace test {
template <class X> void check_equivalent_keys(X const& x1)
{
BOOST_DEDUCED_TYPENAME X::key_equal eq = x1.key_eq();
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
typename X::key_equal eq = x1.key_eq();
typedef typename X::key_type key_type;
std::set<key_type, std::less<key_type> > found_;
BOOST_DEDUCED_TYPENAME X::const_iterator it = x1.begin(), end = x1.end();
BOOST_DEDUCED_TYPENAME X::size_type size = 0;
typename X::const_iterator it = x1.begin(), end = x1.end();
typename X::size_type size = 0;
while (it != end) {
// First test that the current key has not occurred before, required
// to test either that keys are unique or that equivalent keys are
@@ -60,9 +60,9 @@ namespace test {
// Check that the keys are in the correct bucket and are
// adjacent in the bucket.
BOOST_DEDUCED_TYPENAME X::size_type bucket = x1.bucket(key);
BOOST_DEDUCED_TYPENAME X::const_local_iterator lit = x1.begin(bucket),
lend = x1.end(bucket);
typename X::size_type bucket = x1.bucket(key);
typename X::const_local_iterator lit = x1.begin(bucket),
lend = x1.end(bucket);
unsigned int count_checked = 0;
for (; lit != lend && !eq(get_key<X>(*lit), key); ++lit) {
@@ -106,12 +106,11 @@ namespace test {
// Check that size in the buckets matches up.
BOOST_DEDUCED_TYPENAME X::size_type bucket_size = 0;
typename X::size_type bucket_size = 0;
for (BOOST_DEDUCED_TYPENAME X::size_type i = 0; i < x1.bucket_count();
++i) {
for (BOOST_DEDUCED_TYPENAME X::const_local_iterator begin2 = x1.begin(i),
end2 = x1.end(i);
for (typename X::size_type i = 0; i < x1.bucket_count(); ++i) {
for (typename X::const_local_iterator begin2 = x1.begin(i),
end2 = x1.end(i);
begin2 != end2; ++begin2) {
++bucket_size;
}

View File

@@ -81,9 +81,7 @@ namespace test {
list_data& operator=(list_data const&);
};
template <typename T>
class list_iterator
: public std::iterator<std::forward_iterator_tag, T, int, T*, T&>
template <typename T> class list_iterator
{
friend class list_const_iterator<T>;
friend class test::list<T>;
@@ -93,6 +91,12 @@ namespace test {
node* ptr_;
public:
typedef T value_type;
typedef T* pointer;
typedef T& reference;
typedef int difference_type;
typedef std::forward_iterator_tag iterator_category;
list_iterator() : ptr_(0) {}
explicit list_iterator(node* x) : ptr_(x) {}
@@ -113,9 +117,7 @@ namespace test {
bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; }
};
template <typename T>
class list_const_iterator : public std::iterator<std::forward_iterator_tag,
T, int, T const*, T const&>
template <typename T> class list_const_iterator
{
friend class list_iterator<T>;
friend class test::list<T>;
@@ -126,6 +128,12 @@ namespace test {
node* ptr_;
public:
typedef T value_type;
typedef T const* pointer;
typedef T const& reference;
typedef int difference_type;
typedef std::forward_iterator_tag iterator_category;
list_const_iterator() : ptr_(0) {}
list_const_iterator(list_iterator<T> const& x) : ptr_(x.ptr_) {}

View File

@@ -11,23 +11,19 @@
namespace test {
template <class Container>
struct is_set
: public boost::is_same<BOOST_DEDUCED_TYPENAME Container::key_type,
BOOST_DEDUCED_TYPENAME Container::value_type>
struct is_set : public boost::is_same<typename Container::key_type,
typename Container::value_type>
{
};
template <class Container> struct has_unique_keys
{
static char flip(BOOST_DEDUCED_TYPENAME Container::iterator const&);
static long flip(
std::pair<BOOST_DEDUCED_TYPENAME Container::iterator, bool> const&);
static char flip(typename Container::iterator const&);
static long flip(std::pair<typename Container::iterator, bool> const&);
BOOST_STATIC_CONSTANT(bool,
value = sizeof(long) ==
sizeof(
flip(((Container*)0)
->insert(
*(BOOST_DEDUCED_TYPENAME Container::value_type*)0))));
sizeof(flip(
((Container*)0)->insert(*(typename Container::value_type*)0))));
};
}

View File

@@ -15,7 +15,7 @@
namespace test {
template <class X> struct unordered_generator_set
{
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
typedef typename X::value_type value_type;
random_generator type_;
@@ -41,8 +41,8 @@ namespace test {
template <class X> struct unordered_generator_map
{
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
typedef BOOST_DEDUCED_TYPENAME X::mapped_type mapped_type;
typedef typename X::key_type key_type;
typedef typename X::mapped_type mapped_type;
random_generator type_;
@@ -78,7 +78,7 @@ namespace test {
template <class X>
struct unordered_generator : public unordered_generator_base<X>::type
{
typedef BOOST_DEDUCED_TYPENAME unordered_generator_base<X>::type base;
typedef typename unordered_generator_base<X>::type base;
unordered_generator(random_generator const& type = default_generator)
: base(type)
@@ -87,7 +87,7 @@ namespace test {
};
template <class X>
struct random_values : public test::list<BOOST_DEDUCED_TYPENAME X::value_type>
struct random_values : public test::list<typename X::value_type>
{
random_values() {}

View File

@@ -15,7 +15,7 @@
namespace test {
template <class X> class strong
{
typedef test::list<BOOST_DEDUCED_TYPENAME X::value_type> values_type;
typedef test::list<typename X::value_type> values_type;
values_type values_;
unsigned int allocations_;

View File

@@ -6,7 +6,7 @@
#if !defined(BOOST_UNORDERED_TEST_TEST_HEADER)
#define BOOST_UNORDERED_TEST_TEST_HEADER
#include <boost/detail/lightweight_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/stringize.hpp>

View File

@@ -22,7 +22,7 @@
namespace test {
template <typename X> struct equals_to_compare
{
typedef std::less<BOOST_DEDUCED_TYPENAME X::first_argument_type> type;
typedef std::less<typename X::first_argument_type> type;
};
template <> struct equals_to_compare<test::equal_to>
@@ -32,7 +32,7 @@ namespace test {
template <class X1, class X2> void compare_range(X1 const& x1, X2 const& x2)
{
typedef test::list<BOOST_DEDUCED_TYPENAME X1::value_type> value_list;
typedef test::list<typename X1::value_type> value_list;
value_list values1(x1.begin(), x1.end());
value_list values2(x2.begin(), x2.end());
values1.sort();
@@ -60,44 +60,38 @@ namespace test {
template <typename X> struct ordered_base<X, true, true>
{
typedef std::set<BOOST_DEDUCED_TYPENAME X::value_type,
BOOST_DEDUCED_TYPENAME
equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
typedef std::set<typename X::value_type,
typename equals_to_compare<typename X::key_equal>::type>
type;
};
template <typename X> struct ordered_base<X, true, false>
{
typedef std::multiset<BOOST_DEDUCED_TYPENAME X::value_type,
BOOST_DEDUCED_TYPENAME
equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
typedef std::multiset<typename X::value_type,
typename equals_to_compare<typename X::key_equal>::type>
type;
};
template <typename X> struct ordered_base<X, false, true>
{
typedef std::map<BOOST_DEDUCED_TYPENAME X::key_type,
BOOST_DEDUCED_TYPENAME X::mapped_type,
BOOST_DEDUCED_TYPENAME
equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
typedef std::map<typename X::key_type, typename X::mapped_type,
typename equals_to_compare<typename X::key_equal>::type>
type;
};
template <typename X> struct ordered_base<X, false, false>
{
typedef std::multimap<BOOST_DEDUCED_TYPENAME X::key_type,
BOOST_DEDUCED_TYPENAME X::mapped_type,
BOOST_DEDUCED_TYPENAME
equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
typedef std::multimap<typename X::key_type, typename X::mapped_type,
typename equals_to_compare<typename X::key_equal>::type>
type;
};
template <class X> class ordered : public ordered_base<X>::type
{
typedef BOOST_DEDUCED_TYPENAME ordered_base<X>::type base;
typedef typename ordered_base<X>::type base;
public:
typedef BOOST_DEDUCED_TYPENAME base::key_compare key_compare;
typedef typename base::key_compare key_compare;
ordered() : base() {}
@@ -105,12 +99,10 @@ namespace test {
void compare(X const& x) { compare_range(x, *this); }
void compare_key(
X const& x, BOOST_DEDUCED_TYPENAME X::value_type const& val)
void compare_key(X const& x, typename X::value_type const& val)
{
compare_pairs(x.equal_range(get_key<X>(val)),
this->equal_range(get_key<X>(val)),
(BOOST_DEDUCED_TYPENAME X::value_type*)0);
this->equal_range(get_key<X>(val)), (typename X::value_type*)0);
}
template <class It> void insert_range(It b, It e)
@@ -123,10 +115,9 @@ namespace test {
};
template <class Equals>
BOOST_DEDUCED_TYPENAME equals_to_compare<Equals>::type create_compare(
Equals const&)
typename equals_to_compare<Equals>::type create_compare(Equals const&)
{
BOOST_DEDUCED_TYPENAME equals_to_compare<Equals>::type x;
typename equals_to_compare<Equals>::type x;
return x;
}