diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-24 08:20:09 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-24 08:20:09 +0300 |
commit | bc3c9823a956f2c1b75508bfb618626b163bb224 (patch) | |
tree | 4d371543af7a55a65ce5cc7bde6b6454438084af /contrib | |
parent | f6f06f8d3d3fa32513405736aeceb52a801d9a19 (diff) | |
download | ydb-bc3c9823a956f2c1b75508bfb618626b163bb224.tar.gz |
Update contrib/restricted/boost/random to 1.80.0
Diffstat (limited to 'contrib')
13 files changed, 48 insertions, 59 deletions
diff --git a/contrib/restricted/boost/integer/include/boost/pending/integer_log2.hpp b/contrib/restricted/boost/integer/include/boost/pending/integer_log2.hpp deleted file mode 100644 index 938459463d..0000000000 --- a/contrib/restricted/boost/integer/include/boost/pending/integer_log2.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef BOOST_PENDING_INTEGER_LOG2_HPP -#define BOOST_PENDING_INTEGER_LOG2_HPP - -#include <boost/integer/integer_log2.hpp> -#include <boost/config/header_deprecated.hpp> - -BOOST_HEADER_DEPRECATED("<boost/integer/integer_log2.hpp>"); - -#endif diff --git a/contrib/restricted/boost/random/include/boost/random/detail/integer_log2.hpp b/contrib/restricted/boost/random/include/boost/random/detail/integer_log2.hpp index 248243a4b2..2e49f281fc 100644 --- a/contrib/restricted/boost/random/include/boost/random/detail/integer_log2.hpp +++ b/contrib/restricted/boost/random/include/boost/random/detail/integer_log2.hpp @@ -16,7 +16,7 @@ #include <boost/config.hpp> #include <boost/limits.hpp> -#include <boost/pending/integer_log2.hpp> +#include <boost/integer/integer_log2.hpp> namespace boost { namespace random { diff --git a/contrib/restricted/boost/random/include/boost/random/detail/operators.hpp b/contrib/restricted/boost/random/include/boost/random/detail/operators.hpp index 597343c907..f363f37b9e 100644 --- a/contrib/restricted/boost/random/include/boost/random/detail/operators.hpp +++ b/contrib/restricted/boost/random/include/boost/random/detail/operators.hpp @@ -43,7 +43,7 @@ #endif -#if defined(__BORLANDC__) +#if defined(BOOST_BORLANDC) #define BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(T, lhs, rhs) \ bool operator==(const T& rhs) const \ diff --git a/contrib/restricted/boost/random/include/boost/random/detail/seed.hpp b/contrib/restricted/boost/random/include/boost/random/detail/seed.hpp index 557482ad4b..d2e424aca5 100644 --- a/contrib/restricted/boost/random/include/boost/random/detail/seed.hpp +++ b/contrib/restricted/boost/random/include/boost/random/detail/seed.hpp @@ -17,11 +17,10 @@ // Sun seems to have trouble with the use of SFINAE for the // templated constructor. So does Borland. -#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__) +#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(BOOST_BORLANDC) #include <boost/utility/enable_if.hpp> #include <boost/type_traits/is_arithmetic.hpp> -#include <boost/mpl/bool.hpp> namespace boost { namespace random { @@ -64,7 +63,6 @@ struct disable_constructor<Engine, Engine> {}; #else #include <boost/type_traits/is_arithmetic.hpp> -#include <boost/mpl/bool.hpp> #define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \ Self(Self& other) { *this = other; } \ @@ -74,7 +72,7 @@ struct disable_constructor<Engine, Engine> {}; boost_random_constructor_impl(gen, ::boost::is_arithmetic<Generator>());\ } \ template<class Generator> \ - void boost_random_constructor_impl(Generator& gen, ::boost::mpl::false_) + void boost_random_constructor_impl(Generator& gen, ::boost::false_type) #define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \ template<class Generator> \ @@ -82,7 +80,7 @@ struct disable_constructor<Engine, Engine> {}; boost_random_seed_impl(gen, ::boost::is_arithmetic<Generator>());\ }\ template<class Generator>\ - void boost_random_seed_impl(Generator& gen, ::boost::mpl::false_) + void boost_random_seed_impl(Generator& gen, ::boost::false_type) #define BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(Self, SeedSeq, seq) \ Self(Self& other) { *this = other; } \ @@ -92,7 +90,7 @@ struct disable_constructor<Engine, Engine> {}; boost_random_constructor_impl(seq, ::boost::is_arithmetic<SeedSeq>());\ } \ template<class SeedSeq> \ - void boost_random_constructor_impl(SeedSeq& seq, ::boost::mpl::false_) + void boost_random_constructor_impl(SeedSeq& seq, ::boost::false_type) #define BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(Self, SeedSeq, seq) \ template<class SeedSeq> \ @@ -100,15 +98,15 @@ struct disable_constructor<Engine, Engine> {}; boost_random_seed_impl(seq, ::boost::is_arithmetic<SeedSeq>()); \ } \ template<class SeedSeq> \ - void boost_random_seed_impl(SeedSeq& seq, ::boost::mpl::false_) + void boost_random_seed_impl(SeedSeq& seq, ::boost::false_type) #define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \ - explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::mpl::true_()); }\ - void boost_random_constructor_impl(const T& x, ::boost::mpl::true_) + explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::true_type()); }\ + void boost_random_constructor_impl(const T& x, ::boost::true_type) #define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \ - void seed(const T& x) { boost_random_seed_impl(x, ::boost::mpl::true_()); }\ - void boost_random_seed_impl(const T& x, ::boost::mpl::true_) + void seed(const T& x) { boost_random_seed_impl(x, ::boost::true_type()); }\ + void boost_random_seed_impl(const T& x, ::boost::true_type) #endif diff --git a/contrib/restricted/boost/random/include/boost/random/detail/seed_impl.hpp b/contrib/restricted/boost/random/include/boost/random/detail/seed_impl.hpp index 918a294457..5e79582a2d 100644 --- a/contrib/restricted/boost/random/include/boost/random/detail/seed_impl.hpp +++ b/contrib/restricted/boost/random/include/boost/random/detail/seed_impl.hpp @@ -20,13 +20,12 @@ #include <boost/integer/integer_mask.hpp> #include <boost/integer/static_log2.hpp> #include <boost/random/traits.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/if.hpp> -#include <boost/mpl/int.hpp> #include <boost/random/detail/const_mod.hpp> #include <boost/random/detail/integer_log2.hpp> #include <boost/random/detail/signed_unsigned_tools.hpp> #include <boost/random/detail/generator_bits.hpp> +#include <boost/type_traits/conditional.hpp> +#include <boost/type_traits/integral_constant.hpp> #include <boost/random/detail/disable_warnings.hpp> @@ -41,7 +40,7 @@ namespace detail { template<class T> struct seed_type { - typedef typename boost::mpl::if_<boost::is_integral<T>, + typedef typename boost::conditional<boost::is_integral<T>::value, T, boost::uint32_t >::type type; @@ -203,13 +202,13 @@ void generate_from_int(Engine& eng, Iter begin, Iter end) } template<class Engine, class Iter> -void generate_impl(Engine& eng, Iter first, Iter last, boost::mpl::true_) +void generate_impl(Engine& eng, Iter first, Iter last, boost::true_type) { return detail::generate_from_int(eng, first, last); } template<class Engine, class Iter> -void generate_impl(Engine& eng, Iter first, Iter last, boost::mpl::false_) +void generate_impl(Engine& eng, Iter first, Iter last, boost::false_type) { return detail::generate_from_real(eng, first, last); } @@ -225,8 +224,8 @@ void generate(Engine& eng, Iter first, Iter last) template<class IntType, IntType m, class SeedSeq> IntType seed_one_int(SeedSeq& seq) { - static const int log = ::boost::mpl::if_c<(m == 0), - ::boost::mpl::int_<(::std::numeric_limits<IntType>::digits)>, + static const int log = ::boost::conditional<(m == 0), + ::boost::integral_constant<int, (::std::numeric_limits<IntType>::digits)>, ::boost::static_log2<m> >::type::value; static const int k = (log + ((~(static_cast<IntType>(2) << (log - 1)) & m)? 32 : 31)) / 32; @@ -244,8 +243,8 @@ IntType seed_one_int(SeedSeq& seq) template<class IntType, IntType m, class Iter> IntType get_one_int(Iter& first, Iter last) { - static const int log = ::boost::mpl::if_c<(m == 0), - ::boost::mpl::int_<(::std::numeric_limits<IntType>::digits)>, + static const int log = ::boost::conditional<(m == 0), + ::boost::integral_constant<int, (::std::numeric_limits<IntType>::digits)>, ::boost::static_log2<m> >::type::value; static const int k = (log + ((~(static_cast<IntType>(2) << (log - 1)) & m)? 32 : 31)) / 32; @@ -277,7 +276,7 @@ void seed_array_int_impl(SeedSeq& seq, UIntType (&x)[n]) } template<int w, std::size_t n, class SeedSeq, class IntType> -inline void seed_array_int_impl(SeedSeq& seq, IntType (&x)[n], boost::mpl::true_) +inline void seed_array_int_impl(SeedSeq& seq, IntType (&x)[n], boost::true_type) { BOOST_STATIC_ASSERT_MSG(boost::is_integral<IntType>::value, "Sorry but this routine has not been ported to non built-in integers as it relies on a reinterpret_cast."); typedef typename boost::make_unsigned<IntType>::type unsigned_array[n]; @@ -285,7 +284,7 @@ inline void seed_array_int_impl(SeedSeq& seq, IntType (&x)[n], boost::mpl::true_ } template<int w, std::size_t n, class SeedSeq, class IntType> -inline void seed_array_int_impl(SeedSeq& seq, IntType (&x)[n], boost::mpl::false_) +inline void seed_array_int_impl(SeedSeq& seq, IntType (&x)[n], boost::false_type) { seed_array_int_impl<w>(seq, x); } @@ -312,7 +311,7 @@ void fill_array_int_impl(Iter& first, Iter last, UIntType (&x)[n]) } template<int w, std::size_t n, class Iter, class IntType> -inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::mpl::true_) +inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::true_type) { BOOST_STATIC_ASSERT_MSG(boost::is_integral<IntType>::value, "Sorry but this routine has not been ported to non built-in integers as it relies on a reinterpret_cast."); typedef typename boost::make_unsigned<IntType>::type unsigned_array[n]; @@ -320,7 +319,7 @@ inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost:: } template<int w, std::size_t n, class Iter, class IntType> -inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::mpl::false_) +inline void fill_array_int_impl(Iter& first, Iter last, IntType (&x)[n], boost::false_type) { fill_array_int_impl<w>(first, last, x); } diff --git a/contrib/restricted/boost/random/include/boost/random/linear_feedback_shift.hpp b/contrib/restricted/boost/random/include/boost/random/linear_feedback_shift.hpp index a695dfde97..a5c2ce7a2b 100644 --- a/contrib/restricted/boost/random/include/boost/random/linear_feedback_shift.hpp +++ b/contrib/restricted/boost/random/include/boost/random/linear_feedback_shift.hpp @@ -52,9 +52,9 @@ public: BOOST_STATIC_CONSTANT(UIntType, default_seed = 341); /** Returns the smallest value that the generator can produce. */ - static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } + static BOOST_CONSTEXPR result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } /** Returns the largest value that the generator can produce. */ - static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () + static BOOST_CONSTEXPR result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return wordmask(); } BOOST_STATIC_ASSERT(w > 0); @@ -168,7 +168,7 @@ public: private: /// \cond show_private - static UIntType wordmask() { return boost::low_bits_mask_t<w>::sig_bits; } + static BOOST_CONSTEXPR UIntType wordmask() { return boost::low_bits_mask_t<w>::sig_bits; } /// \endcond UIntType value; }; diff --git a/contrib/restricted/boost/random/include/boost/random/mersenne_twister.hpp b/contrib/restricted/boost/random/include/boost/random/mersenne_twister.hpp index ce73e6825f..5fefb280ae 100644 --- a/contrib/restricted/boost/random/include/boost/random/mersenne_twister.hpp +++ b/contrib/restricted/boost/random/include/boost/random/mersenne_twister.hpp @@ -177,10 +177,10 @@ public: } /** Returns the smallest value that the generator can produce. */ - static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () + static BOOST_CONSTEXPR result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } /** Returns the largest value that the generator can produce. */ - static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () + static BOOST_CONSTEXPR result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return boost::low_bits_mask_t<w>::sig_bits; } /** Produces the next value of the generator. */ diff --git a/contrib/restricted/boost/random/include/boost/random/random_device.hpp b/contrib/restricted/boost/random/include/boost/random/random_device.hpp index 8f3903c953..b155cd2fe0 100644 --- a/contrib/restricted/boost/random/include/boost/random/random_device.hpp +++ b/contrib/restricted/boost/random/include/boost/random/random_device.hpp @@ -93,9 +93,9 @@ public: BOOST_STATIC_CONSTANT(bool, has_fixed_range = false); /** Returns the smallest value that the \random_device can produce. */ - static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } + static BOOST_CONSTEXPR result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } /** Returns the largest value that the \random_device can produce. */ - static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return ~0u; } + static BOOST_CONSTEXPR result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return ~0u; } /** Constructs a @c random_device, optionally using the default device. */ BOOST_RANDOM_DECL random_device(); diff --git a/contrib/restricted/boost/random/include/boost/random/traits.hpp b/contrib/restricted/boost/random/include/boost/random/traits.hpp index 975421a4d0..437157cd3b 100644 --- a/contrib/restricted/boost/random/include/boost/random/traits.hpp +++ b/contrib/restricted/boost/random/include/boost/random/traits.hpp @@ -19,10 +19,10 @@ #ifndef BOOST_RANDOM_TRAITS_HPP #define BOOST_RANDOM_TRAITS_HPP +#include <boost/type_traits/integral_constant.hpp> #include <boost/type_traits/is_signed.hpp> #include <boost/type_traits/is_integral.hpp> #include <boost/type_traits/make_unsigned.hpp> -#include <boost/mpl/bool.hpp> #include <limits> namespace boost { @@ -92,12 +92,12 @@ namespace traits { */ template <class T> struct is_integral - : public mpl::bool_<boost::is_integral<T>::value || (std::numeric_limits<T>::is_integer)> + : public integral_constant<bool, boost::is_integral<T>::value || (std::numeric_limits<T>::is_integer)> {}; /** \brief Traits class that indicates whether type T is a signed integer */ template <class T> struct is_signed - : public mpl::bool_ < boost::is_signed<T>::value || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed)> + : public integral_constant<bool, boost::is_signed<T>::value || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed)> {}; } diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp index e0d3a9bebc..8a3ea7b89f 100644 --- a/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp +++ b/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp @@ -29,9 +29,9 @@ #include <boost/random/detail/uniform_int_float.hpp> #include <boost/random/detail/signed_unsigned_tools.hpp> #include <boost/random/traits.hpp> -#include <boost/mpl/bool.hpp> +#include <boost/type_traits/integral_constant.hpp> #ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS -#include <boost/mpl/if.hpp> +#include <boost/type_traits/conditional.hpp> #endif namespace boost { @@ -49,7 +49,7 @@ namespace detail { template<class Engine, class T> T generate_uniform_int( Engine& eng, T min_value, T max_value, - boost::mpl::true_ /** is_integral<Engine::result_type> */) + boost::true_type /** is_integral<Engine::result_type> */) { typedef T result_type; typedef typename boost::random::traits::make_unsigned_or_unbounded<T>::type range_type; @@ -167,7 +167,7 @@ T generate_uniform_int( eng, static_cast<range_type>(0), static_cast<range_type>(range/mult), - boost::mpl::true_()); + boost::true_type()); if(std::numeric_limits<range_type>::is_bounded && ((std::numeric_limits<range_type>::max)() / mult < result_increment)) { // The multiplcation would overflow. Reject immediately. continue; @@ -187,7 +187,7 @@ T generate_uniform_int( } } else { // brange > range #ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS - typedef typename mpl::if_c< + typedef typename conditional< std::numeric_limits<range_type>::is_specialized && std::numeric_limits<base_unsigned>::is_specialized && (std::numeric_limits<range_type>::digits >= std::numeric_limits<base_unsigned>::digits), range_type, base_unsigned>::type mixed_range_type; @@ -234,10 +234,10 @@ T generate_uniform_int( template<class Engine, class T> inline T generate_uniform_int( Engine& eng, T min_value, T max_value, - boost::mpl::false_ /** is_integral<Engine::result_type> */) + boost::false_type /** is_integral<Engine::result_type> */) { uniform_int_float<Engine> wrapper(eng); - return generate_uniform_int(wrapper, min_value, max_value, boost::mpl::true_()); + return generate_uniform_int(wrapper, min_value, max_value, boost::true_type()); } template<class Engine, class T> diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp index 820fce9314..ebbc351a60 100644 --- a/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp +++ b/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp @@ -24,7 +24,6 @@ #include <boost/random/detail/operators.hpp> #include <boost/random/detail/signed_unsigned_tools.hpp> #include <boost/type_traits/is_integral.hpp> -#include <boost/mpl/bool.hpp> namespace boost { namespace random { @@ -33,7 +32,7 @@ namespace detail { template<class Engine, class T> T generate_uniform_real( Engine& eng, T min_value, T max_value, - boost::mpl::false_ /** is_integral<Engine::result_type> */) + boost::false_type /** is_integral<Engine::result_type> */) { for(;;) { typedef T result_type; @@ -49,7 +48,7 @@ T generate_uniform_real( template<class Engine, class T> T generate_uniform_real( Engine& eng, T min_value, T max_value, - boost::mpl::true_ /** is_integral<Engine::result_type> */) + boost::true_type /** is_integral<Engine::result_type> */) { for(;;) { typedef T result_type; diff --git a/contrib/restricted/boost/random/include/boost/random/xor_combine.hpp b/contrib/restricted/boost/random/include/boost/random/xor_combine.hpp index fe8a58b40f..312fdb8dbb 100644 --- a/contrib/restricted/boost/random/include/boost/random/xor_combine.hpp +++ b/contrib/restricted/boost/random/include/boost/random/xor_combine.hpp @@ -135,9 +135,11 @@ public: } /** Returns the smallest value that the generator can produce. */ - static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return (std::min)((URNG1::min)(), (URNG2::min)()); } + static BOOST_CONSTEXPR result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () + { return (URNG1::min)()<(URNG2::min)()?(URNG1::min)():(URNG2::min)(); } /** Returns the largest value that the generator can produce. */ - static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return (std::max)((URNG1::min)(), (URNG2::max)()); } + static BOOST_CONSTEXPR result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () + { return (URNG1::max)()>(URNG2::max)()?(URNG1::max)():(URNG2::max)(); } /** * Writes the textual representation of the generator to a @c std::ostream. diff --git a/contrib/restricted/boost/random/src/random_device.cpp b/contrib/restricted/boost/random/src/random_device.cpp index 8ec3863107..35730d0bb6 100644 --- a/contrib/restricted/boost/random/src/random_device.cpp +++ b/contrib/restricted/boost/random/src/random_device.cpp @@ -48,7 +48,7 @@ using namespace Windows::Security::Cryptography; #endif #define BOOST_AUTO_LINK_NOMANGLE -#define BOOST_LIB_NAME "Advapi32" +#define BOOST_LIB_NAME Advapi32 #include <boost/config/auto_link.hpp> #ifdef __MINGW32__ |