diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-09-18 22:43:12 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-09-18 22:43:12 +0300 |
commit | 9481fc41c4a4157132c64334fbd44bc07f6c8e53 (patch) | |
tree | 9e2f3f3fab2cceecfe6a0741bef42302daebf879 /contrib/restricted | |
parent | 12b04172957edb67847ab99f35b6e805b24804d9 (diff) | |
download | ydb-9481fc41c4a4157132c64334fbd44bc07f6c8e53.tar.gz |
Update contrib/restricted/boost/utility to 1.79.0
Diffstat (limited to 'contrib/restricted')
10 files changed, 346 insertions, 118 deletions
diff --git a/contrib/restricted/boost/utility/README.md b/contrib/restricted/boost/utility/README.md new file mode 100644 index 0000000000..7608f684f9 --- /dev/null +++ b/contrib/restricted/boost/utility/README.md @@ -0,0 +1,26 @@ +# ![Boost.Utility](doc/logo.png) + +Boost.Utility, part of collection of the [Boost C++ Libraries](https://github.com/boostorg), provides a number of smaller components, too small to be called libraries in their own right. See the documentation for the list of components. + +### Directories + +* **doc** - Documentation sources +* **include** - Interface headers of Boost.Utility +* **test** - Boost.Utility unit tests + +### More information + +* [Documentation](https://boost.org/libs/utility) +* [Report bugs](https://github.com/boostorg/utility/issues/new). Be sure to mention Boost version, Boost.Utility component, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well. +* Submit your patches as pull requests against **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt). + +### Build status + +Branch | GitHub Actions | AppVeyor | Test Matrix | Dependencies | +:-------------: | -------------- | -------- | ----------- | ------------ | +[`master`](https://github.com/boostorg/utility/tree/master) | [![GitHub Actions](https://github.com/boostorg/utility/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/utility/actions?query=branch%3Amaster) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/g09ehuy2o6aq42th/branch/master?svg=true)](https://ci.appveyor.com/project/Lastique/utility/branch/master) | [![Tests](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/utility.html) | [![Dependencies](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/utility.html) +[`develop`](https://github.com/boostorg/utility/tree/develop) | [![GitHub Actions](https://github.com/boostorg/utility/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/utility/actions?query=branch%3Adevelop) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/g09ehuy2o6aq42th/branch/develop?svg=true)](https://ci.appveyor.com/project/Lastique/utility/branch/develop) | [![Tests](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/utility.html) | [![Dependencies](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/utility.html) + +### License + +Distributed under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt). diff --git a/contrib/restricted/boost/utility/include/boost/detail/call_traits.hpp b/contrib/restricted/boost/utility/include/boost/detail/call_traits.hpp index 36dea0003a..feca93da37 100644 --- a/contrib/restricted/boost/utility/include/boost/detail/call_traits.hpp +++ b/contrib/restricted/boost/utility/include/boost/detail/call_traits.hpp @@ -100,7 +100,7 @@ struct call_traits<T&> typedef T& param_type; // hh removed const }; -#if BOOST_WORKAROUND( __BORLANDC__, < 0x5A0 ) +#if BOOST_WORKAROUND( BOOST_BORLANDC, < 0x5A0 ) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified diff --git a/contrib/restricted/boost/utility/include/boost/detail/compressed_pair.hpp b/contrib/restricted/boost/utility/include/boost/detail/compressed_pair.hpp index 5dc21e23e6..28de0bfc2c 100644 --- a/contrib/restricted/boost/utility/include/boost/detail/compressed_pair.hpp +++ b/contrib/restricted/boost/utility/include/boost/detail/compressed_pair.hpp @@ -24,6 +24,7 @@ #include <boost/type_traits/remove_cv.hpp> #include <boost/type_traits/is_empty.hpp> +#include <boost/type_traits/is_final.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/call_traits.hpp> @@ -42,6 +43,14 @@ class compressed_pair; namespace details { + template<class T, bool E = boost::is_final<T>::value> + struct compressed_pair_empty + : ::boost::false_type { }; + + template<class T> + struct compressed_pair_empty<T, false> + : ::boost::is_empty<T> { }; + // JM altered 26 Jan 2000: template <class T1, class T2, bool IsSame, bool FirstEmpty, bool SecondEmpty> struct compressed_pair_switch; @@ -338,13 +347,15 @@ namespace details template <class T1, class T2> class compressed_pair - : private ::boost::details::compressed_pair_imp<T1, T2, +#ifndef BOOST_UTILITY_DOCS + : private ::boost::details::compressed_pair_imp<T1, T2, ::boost::details::compressed_pair_switch< T1, T2, ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value, - ::boost::is_empty<T1>::value, - ::boost::is_empty<T2>::value>::value> + ::boost::details::compressed_pair_empty<T1>::value, + ::boost::details::compressed_pair_empty<T2>::value>::value> +#endif // BOOST_UTILITY_DOCS { private: typedef details::compressed_pair_imp<T1, T2, @@ -352,8 +363,8 @@ private: T1, T2, ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value, - ::boost::is_empty<T1>::value, - ::boost::is_empty<T2>::value>::value> base; + ::boost::details::compressed_pair_empty<T1>::value, + ::boost::details::compressed_pair_empty<T2>::value>::value> base; public: typedef T1 first_type; typedef T2 second_type; @@ -383,13 +394,15 @@ public: // template <class T> class compressed_pair<T, T> +#ifndef BOOST_UTILITY_DOCS : private details::compressed_pair_imp<T, T, ::boost::details::compressed_pair_switch< T, T, ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value, - ::boost::is_empty<T>::value, - ::boost::is_empty<T>::value>::value> + ::boost::details::compressed_pair_empty<T>::value, + ::boost::details::compressed_pair_empty<T>::value>::value> +#endif // BOOST_UTILITY_DOCS { private: typedef details::compressed_pair_imp<T, T, @@ -397,8 +410,8 @@ private: T, T, ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value, - ::boost::is_empty<T>::value, - ::boost::is_empty<T>::value>::value> base; + ::boost::details::compressed_pair_empty<T>::value, + ::boost::details::compressed_pair_empty<T>::value>::value> base; public: typedef T first_type; typedef T second_type; diff --git a/contrib/restricted/boost/utility/include/boost/operators.hpp b/contrib/restricted/boost/utility/include/boost/operators.hpp index 156571c1a9..be56a2f880 100644 --- a/contrib/restricted/boost/utility/include/boost/operators.hpp +++ b/contrib/restricted/boost/utility/include/boost/operators.hpp @@ -109,6 +109,15 @@ # pragma warning( disable : 4284 ) // complaint about return type of #endif // operator-> not begin a UDT +// Define BOOST_OPERATORS_CONSTEXPR to be like BOOST_CONSTEXPR but empty under MSVC < v19.22 +#if BOOST_WORKAROUND(BOOST_MSVC, < 1922) +#define BOOST_OPERATORS_CONSTEXPR +#elif defined __sun +#define BOOST_OPERATORS_CONSTEXPR +#else +#define BOOST_OPERATORS_CONSTEXPR BOOST_CONSTEXPR +#endif + // In this section we supply the xxxx1 and xxxx2 forms of the operator // templates, which are explicitly targeted at the 1-type-argument and // 2-type-argument operator forms, respectively. @@ -132,34 +141,34 @@ template <typename T> class empty_base {}; template <class T, class U, class B = operators_detail::empty_base<T> > struct less_than_comparable2 : B { - friend bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); } - friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); } - friend bool operator>(const U& x, const T& y) { return y < x; } - friend bool operator<(const U& x, const T& y) { return y > x; } - friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); } - friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const U& x, const T& y) { return y < x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<(const U& x, const T& y) { return y > x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); } }; template <class T, class B = operators_detail::empty_base<T> > struct less_than_comparable1 : B { - friend bool operator>(const T& x, const T& y) { return y < x; } - friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); } - friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const T& x, const T& y) { return y < x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); } }; template <class T, class U, class B = operators_detail::empty_base<T> > struct equality_comparable2 : B { - friend bool operator==(const U& y, const T& x) { return x == y; } - friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); } - friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const U& y, const T& x) { return x == y; } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); } }; template <class T, class B = operators_detail::empty_base<T> > struct equality_comparable1 : B { - friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); } }; // A macro which produces "name_2left" from "name". @@ -362,7 +371,7 @@ BOOST_BINARY_OPERATOR( right_shiftable, >> ) template <class T, class U, class B = operators_detail::empty_base<T> > struct equivalent2 : B { - friend bool operator==(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const T& x, const U& y) { return !static_cast<bool>(x < y) && !static_cast<bool>(x > y); } @@ -371,7 +380,7 @@ struct equivalent2 : B template <class T, class B = operators_detail::empty_base<T> > struct equivalent1 : B { - friend bool operator==(const T&x, const T&y) + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const T&x, const T&y) { return !static_cast<bool>(x < y) && !static_cast<bool>(y < x); } @@ -380,28 +389,28 @@ struct equivalent1 : B template <class T, class U, class B = operators_detail::empty_base<T> > struct partially_ordered2 : B { - friend bool operator<=(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const U& y) { return static_cast<bool>(x < y) || static_cast<bool>(x == y); } - friend bool operator>=(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const U& y) { return static_cast<bool>(x > y) || static_cast<bool>(x == y); } - friend bool operator>(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const U& x, const T& y) { return y < x; } - friend bool operator<(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<(const U& x, const T& y) { return y > x; } - friend bool operator<=(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const U& x, const T& y) { return static_cast<bool>(y > x) || static_cast<bool>(y == x); } - friend bool operator>=(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const U& x, const T& y) { return static_cast<bool>(y < x) || static_cast<bool>(y == x); } }; template <class T, class B = operators_detail::empty_base<T> > struct partially_ordered1 : B { - friend bool operator>(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const T& x, const T& y) { return y < x; } - friend bool operator<=(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const T& y) { return static_cast<bool>(x < y) || static_cast<bool>(x == y); } - friend bool operator>=(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const T& y) { return static_cast<bool>(y < x) || static_cast<bool>(x == y); } }; diff --git a/contrib/restricted/boost/utility/include/boost/utility/base_from_member.hpp b/contrib/restricted/boost/utility/include/boost/utility/base_from_member.hpp index 604541d19a..614fad7d49 100644 --- a/contrib/restricted/boost/utility/include/boost/utility/base_from_member.hpp +++ b/contrib/restricted/boost/utility/include/boost/utility/base_from_member.hpp @@ -47,13 +47,14 @@ // {} // This macro should only persist within this file. +#ifndef BOOST_UTILITY_DOCS #define BOOST_PRIVATE_CTR_DEF( z, n, data ) \ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ {} \ /**/ - +#endif // BOOST_UTILITY_DOCS namespace boost { diff --git a/contrib/restricted/boost/utility/include/boost/utility/binary.hpp b/contrib/restricted/boost/utility/include/boost/utility/binary.hpp index 8cef1468e5..2c3189a604 100644 --- a/contrib/restricted/boost/utility/include/boost/utility/binary.hpp +++ b/contrib/restricted/boost/utility/include/boost/utility/binary.hpp @@ -68,6 +68,7 @@ ( (0) BOOST_DETAIL_CREATE_BINARY_LITERAL_OCTAL_SEQUENCE( d, bit_groupings ) \ ) +#ifndef BOOST_UTILITY_DOCS #define BOOST_DETAIL_CREATE_BINARY_LITERAL_OCTAL_SEQUENCE( d, bit_groupings ) \ BOOST_PP_SEQ_TRANSFORM \ ( BOOST_DETAIL_TRIPLE_TO_OCTAL_OPERATION \ @@ -703,6 +704,6 @@ #define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111100 (1)(1)(1)(1)(1)(1)(0)(0), #define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111101 (1)(1)(1)(1)(1)(1)(0)(1), #define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111110 (1)(1)(1)(1)(1)(1)(1)(0), -#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111111 (1)(1)(1)(1)(1)(1)(1)(1), - +#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111111 (1)(1)(1)(1)(1)(1)(1)(1), +#endif // BOOST_UTILITY_DOCS #endif diff --git a/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_iterate.hpp b/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_iterate.hpp index d6538447b1..2ea594464c 100644 --- a/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_iterate.hpp +++ b/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_iterate.hpp @@ -22,7 +22,7 @@ # define BOOST_RESULT_OF_ARGS BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T) #endif -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)> struct tr1_result_of<F(BOOST_RESULT_OF_ARGS)> : conditional< @@ -151,7 +151,7 @@ struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), #else // defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)> struct result_of<F(BOOST_RESULT_OF_ARGS)> : tr1_result_of<F(BOOST_RESULT_OF_ARGS)> { }; @@ -177,7 +177,7 @@ struct tr1_result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), F typedef R type; }; -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)> struct tr1_result_of_impl<R (T0::*) (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)), diff --git a/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_variadic.hpp b/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_variadic.hpp new file mode 100644 index 0000000000..f6929f8a52 --- /dev/null +++ b/contrib/restricted/boost/utility/include/boost/utility/detail/result_of_variadic.hpp @@ -0,0 +1,190 @@ +// Boost result_of library + +// Copyright Douglas Gregor 2004. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Copyright Daniel Walker, Eric Niebler, Michel Morin 2008-2012. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or +// copy at http://www.boost.org/LICENSE_1_0.txt) + +// For more information, see http://www.boost.org/libs/utility + +#ifndef BOOST_RESULT_OF_HPP +# error Boost result_of - do not include this file! +#endif + +template<typename F, typename... Args> +struct tr1_result_of<F(Args...)> + : conditional< + is_pointer<F>::value || is_member_function_pointer<F>::value + , boost::detail::tr1_result_of_impl< + typename remove_cv<F>::type, + typename remove_cv<F>::type(Args...), + (boost::detail::result_of_has_result_type<F>::value)> + , boost::detail::tr1_result_of_impl< + F, + F(Args...), + (boost::detail::result_of_has_result_type<F>::value)> >::type { }; + +#ifdef BOOST_RESULT_OF_USE_DECLTYPE +template<typename F, typename... Args> +struct result_of<F(Args...)> + : detail::cpp0x_result_of<F(Args...)> { }; +#endif // BOOST_RESULT_OF_USE_DECLTYPE + +#ifdef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK +template<typename F, typename... Args> +struct result_of<F(Args...)> + : conditional<detail::result_of_has_result_type<F>::value || detail::result_of_has_result<F>::value, + tr1_result_of<F(Args...)>, + detail::cpp0x_result_of<F(Args...)> >::type { }; +#endif // BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK + +#if defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) + +namespace detail { + +template<typename F, typename... Args> +struct cpp0x_result_of<F(Args...)> + : conditional< + is_member_function_pointer<F>::value + , detail::tr1_result_of_impl< + typename remove_cv<F>::type, + typename remove_cv<F>::type(Args...), false + > + , detail::cpp0x_result_of_impl< + F(Args...) + > + >::type +{}; + +#ifdef BOOST_NO_SFINAE_EXPR + +template<typename F> +struct result_of_callable_fun_2; + +template<typename R, typename... Args> +struct result_of_callable_fun_2<R(Args...)> { + R operator()(Args...) const; + typedef result_of_private_type const &(*pfn_t)(...); + operator pfn_t() const volatile; +}; + +template<typename F> +struct result_of_callable_fun + : result_of_callable_fun_2<F> +{}; + +template<typename F> +struct result_of_callable_fun<F *> + : result_of_callable_fun_2<F> +{}; + +template<typename F> +struct result_of_select_call_wrapper_type + : conditional< + is_class<typename remove_reference<F>::type>::value, + result_of_wrap_callable_class<F>, + type_identity<result_of_callable_fun<typename remove_cv<typename remove_reference<F>::type>::type> > + >::type +{}; + +template<typename F, typename... Args> +struct result_of_is_callable { + typedef typename result_of_select_call_wrapper_type<F>::type wrapper_t; + static const bool value = ( + sizeof(result_of_no_type) == sizeof(detail::result_of_is_private_type( + (boost::declval<wrapper_t>()(boost::declval<Args>()...), result_of_weird_type()) + )) + ); + typedef integral_constant<bool, value> type; +}; + +template<typename F, typename... Args> +struct cpp0x_result_of_impl<F(Args...), true> + : lazy_enable_if< + result_of_is_callable<F, Args...> + , cpp0x_result_of_impl<F(Args...), false> + > +{}; + +template<typename F, typename... Args> +struct cpp0x_result_of_impl<F(Args...), false> +{ + typedef decltype( + boost::declval<F>()( + boost::declval<Args>()... + ) + ) type; +}; + +#else // BOOST_NO_SFINAE_EXPR + +template<typename F, typename... Args> +struct cpp0x_result_of_impl<F(Args...), + typename result_of_always_void<decltype( + boost::declval<F>()( + boost::declval<Args>()... + ) + )>::type> { + typedef decltype( + boost::declval<F>()( + boost::declval<Args>()... + ) + ) type; +}; + +#endif // BOOST_NO_SFINAE_EXPR + +} // namespace detail + +#else // defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) + +template<typename F, typename... Args> +struct result_of<F(Args...)> + : tr1_result_of<F(Args...)> { }; + +#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE) + +namespace detail { + +template<typename R, typename FArgs, typename... Args> +struct tr1_result_of_impl<R (*)(Args...), FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs, typename... Args> +struct tr1_result_of_impl<R (&)(Args...), FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs, typename C, typename... Args> +struct tr1_result_of_impl<R (C::*)(Args...), FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs, typename C, typename... Args> +struct tr1_result_of_impl<R (C::*)(Args...) const, FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs, typename C, typename... Args> +struct tr1_result_of_impl<R (C::*)(Args...) volatile, FArgs, false> +{ + typedef R type; +}; + +template<typename R, typename FArgs, typename C, typename... Args> +struct tr1_result_of_impl<R (C::*)(Args...) const volatile, FArgs, false> +{ + typedef R type; +}; + +} diff --git a/contrib/restricted/boost/utility/include/boost/utility/result_of.hpp b/contrib/restricted/boost/utility/include/boost/utility/result_of.hpp index 2b652ba0ca..bd926899a0 100644 --- a/contrib/restricted/boost/utility/include/boost/utility/result_of.hpp +++ b/contrib/restricted/boost/utility/include/boost/utility/result_of.hpp @@ -10,13 +10,6 @@ #define BOOST_RESULT_OF_HPP #include <boost/config.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/iteration/iterate.hpp> -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_trailing_params.hpp> -#include <boost/preprocessor/repetition/enum_binary_params.hpp> -#include <boost/preprocessor/repetition/enum_shifted_params.hpp> -#include <boost/preprocessor/facilities/intercept.hpp> #include <boost/detail/workaround.hpp> #include <boost/type_traits/is_class.hpp> #include <boost/type_traits/is_pointer.hpp> @@ -29,9 +22,25 @@ #include <boost/type_traits/integral_constant.hpp> #include <boost/core/enable_if.hpp> +#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES +# undef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES +# define BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES +#endif +#ifdef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES +# include <boost/preprocessor/cat.hpp> +# include <boost/preprocessor/iteration/iterate.hpp> +# include <boost/preprocessor/repetition/enum_params.hpp> +# include <boost/preprocessor/repetition/enum_trailing_params.hpp> +# include <boost/preprocessor/repetition/enum_binary_params.hpp> +# include <boost/preprocessor/repetition/enum_shifted_params.hpp> +# include <boost/preprocessor/facilities/intercept.hpp> +#endif + +#ifndef BOOST_UTILITY_DOCS #ifndef BOOST_RESULT_OF_NUM_ARGS # define BOOST_RESULT_OF_NUM_ARGS 16 #endif +#endif // BOOST_UTILITY_DOCS // Use the decltype-based version of result_of by default if the compiler // supports N3276 <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf>. @@ -44,6 +53,7 @@ BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK cannot be defined at the same time. #endif +#ifndef BOOST_UTILITY_DOCS #ifndef BOOST_RESULT_OF_USE_TR1 # ifndef BOOST_RESULT_OF_USE_DECLTYPE # ifndef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK @@ -55,6 +65,7 @@ # endif # endif #endif +#endif // BOOST_UTILITY_DOCS namespace boost { @@ -108,8 +119,8 @@ template<typename F> struct cpp0x_result_of; // There doesn't seem to be any other way to turn this off such that the presence of // the user-defined operator,() below doesn't cause spurious warning all over the place, -// so unconditionally turn it off. -#if BOOST_MSVC +// so unconditionally and globally turn it off. (https://svn.boost.org/trac10/ticket/7663) +#ifdef BOOST_MSVC # pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used #endif @@ -123,12 +134,19 @@ template<typename T> result_of_no_type result_of_is_private_type(T const &); result_of_yes_type result_of_is_private_type(result_of_private_type); +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4512) // assignment operator could not be generated. +#endif template<typename C> struct result_of_callable_class : C { result_of_callable_class(); typedef result_of_private_type const &(*pfn_t)(...); operator pfn_t() const volatile; }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template<typename C> struct result_of_wrap_callable_class { @@ -217,8 +235,12 @@ struct tr1_result_of_impl<F, FArgs, false> } // end namespace detail -#define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>)) -#include BOOST_PP_ITERATE() +#ifndef BOOST_RESULT_OF_NO_VARIADIC_TEMPLATES +# include <boost/utility/detail/result_of_variadic.hpp> +#else +# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>)) +# include BOOST_PP_ITERATE() +#endif #if 0 // inform dependency trackers, as they can't see through macro includes diff --git a/contrib/restricted/boost/utility/include/boost/utility/value_init.hpp b/contrib/restricted/boost/utility/include/boost/utility/value_init.hpp index 9d8de70733..f3d940b1e9 100644 --- a/contrib/restricted/boost/utility/include/boost/utility/value_init.hpp +++ b/contrib/restricted/boost/utility/include/boost/utility/value_init.hpp @@ -1,4 +1,5 @@ // (C) Copyright 2002-2008, Fernando Luis Cacciola Carballal. +// Copyright 2020 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -21,15 +22,10 @@ // issues, by clearing the bytes of T, before constructing the T object it // contains. More details on these issues are at libs/utility/value_init.htm -#include <boost/aligned_storage.hpp> #include <boost/config.hpp> // For BOOST_NO_COMPLETE_VALUE_INITIALIZATION. -#include <boost/detail/workaround.hpp> -#include <boost/static_assert.hpp> -#include <boost/type_traits/cv_traits.hpp> -#include <boost/type_traits/alignment_of.hpp> #include <boost/swap.hpp> #include <cstring> -#include <new> +#include <cstddef> #ifdef BOOST_MSVC #pragma warning(push) @@ -41,6 +37,8 @@ #pragma warning(disable: 4512) #endif +#ifndef BOOST_UTILITY_DOCS + #ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION // Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED // suggests that a workaround should be applied, because of compiler issues @@ -58,94 +56,62 @@ #endif #endif +#endif // BOOST_UTILITY_DOCS + namespace boost { -template<class T> -class initialized -{ - private : - struct wrapper +namespace detail { + + struct zero_init + { + zero_init() { -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592)) - typename -#endif - remove_const<T>::type data; - - BOOST_GPU_ENABLED - wrapper() - : - data() - { - } - - BOOST_GPU_ENABLED - wrapper(T const & arg) - : - data(arg) - { - } - }; - - mutable -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592)) - typename -#endif - aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x; + } - BOOST_GPU_ENABLED - wrapper * wrapper_address() const + zero_init( void * p, std::size_t n ) { - return static_cast<wrapper *>( static_cast<void*>(&x)); + std::memset( p, 0, n ); } + }; - public : +} // namespace detail - BOOST_GPU_ENABLED - initialized() - { +template<class T> +class initialized #if BOOST_DETAIL_VALUE_INIT_WORKAROUND - std::memset(&x, 0, sizeof(x)); + : detail::zero_init #endif - new (wrapper_address()) wrapper(); - } +{ + private: - BOOST_GPU_ENABLED - initialized(initialized const & arg) - { - new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address()))); - } + T data_; - BOOST_GPU_ENABLED - explicit initialized(T const & arg) - { - new (wrapper_address()) wrapper(arg); - } + public : BOOST_GPU_ENABLED - initialized & operator=(initialized const & arg) + initialized(): +#if BOOST_DETAIL_VALUE_INIT_WORKAROUND + zero_init( &const_cast< char& >( reinterpret_cast<char const volatile&>( data_ ) ), sizeof( data_ ) ), +#endif + data_() { - // Assignment is only allowed when T is non-const. - BOOST_STATIC_ASSERT( ! is_const<T>::value ); - *wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address())); - return *this; } BOOST_GPU_ENABLED - ~initialized() + explicit initialized(T const & arg): data_( arg ) { - wrapper_address()->wrapper::~wrapper(); } BOOST_GPU_ENABLED T const & data() const { - return wrapper_address()->data; + return data_; } BOOST_GPU_ENABLED T& data() { - return wrapper_address()->data; + return data_; } BOOST_GPU_ENABLED @@ -157,13 +123,13 @@ class initialized BOOST_GPU_ENABLED operator T const &() const { - return wrapper_address()->data; + return data_; } BOOST_GPU_ENABLED operator T&() { - return wrapper_address()->data; + return data_; } } ; |