diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-07 18:49:56 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-07 18:49:56 +0300 |
commit | 7de748bb7bfdf35788b18552616e209fbe968cf6 (patch) | |
tree | 8e7705f847aa41c1476f3658628cb9bbd45251a8 | |
parent | 32e938fca6761692d33ee4f747b71c9ab83551c1 (diff) | |
download | ydb-7de748bb7bfdf35788b18552616e209fbe968cf6.tar.gz |
Update contrib/restricted/boost/conversion to 1.79.0
3 files changed, 46 insertions, 19 deletions
diff --git a/contrib/restricted/boost/conversion/README.md b/contrib/restricted/boost/conversion/README.md index 2cd1b9d49f8..b3a4d4cf346 100644 --- a/contrib/restricted/boost/conversion/README.md +++ b/contrib/restricted/boost/conversion/README.md @@ -1,16 +1,15 @@ -# [Boost.Conversion](http://boost.org/libs/conversion) -Boost.Conversion is one of the [Boost C++ Libraries](http://github.com/boostorg). This library improves program safety and clarity by performing otherwise messy conversions. +# [Boost.Conversion](https://boost.org/libs/conversion) +Boost.Conversion is one of the [Boost C++ Libraries](https://github.com/boostorg). This library improves program safety and clarity by performing otherwise messy conversions. ### Test results @ | Build | Tests coverage | More info ----------------|-------------- | -------------- |----------- -Develop branch: | [](https://travis-ci.org/apolukhin/conversion) [](https://ci.appveyor.com/project/apolukhin/conversion/branch/develop) | [](https://coveralls.io/r/apolukhin/conversion?branch=develop) | [details...](http://www.boost.org/development/tests/develop/developer/conversion.html) -Master branch: | [](https://travis-ci.org/apolukhin/conversion) [](https://ci.appveyor.com/project/apolukhin/conversion/branch/master) | [](https://coveralls.io/r/apolukhin/conversion?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/conversion.html) +Develop branch: | [](https://github.com/boostorg/conversion/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/conversion/branch/develop) | [](https://coveralls.io/github/boostorg/conversion?branch=develop) | [details...](https://www.boost.org/development/tests/develop/developer/conversion.html) +Master branch: | [](https://github.com/boostorg/conversion/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/conversion/branch/master) | [](https://coveralls.io/github/boostorg/conversion?branch=master) | [details...](https://www.boost.org/development/tests/master/developer/conversion.html) - -[Open Issues](https://svn.boost.org/trac/boost/query?status=!closed&component=conversion&or&status=!closed&component=lexical_cast) +[Latest developer documentation](https://www.boost.org/doc/libs/develop/doc/html/conversion.html) ### License -Distributed under the [Boost Software License, Version 1.0](http://boost.org/LICENSE_1_0.txt). +Distributed under the [Boost Software License, Version 1.0](https://boost.org/LICENSE_1_0.txt). diff --git a/contrib/restricted/boost/conversion/include/boost/implicit_cast.hpp b/contrib/restricted/boost/conversion/include/boost/implicit_cast.hpp index d82db7628ee..09e5f456488 100644 --- a/contrib/restricted/boost/conversion/include/boost/implicit_cast.hpp +++ b/contrib/restricted/boost/conversion/include/boost/implicit_cast.hpp @@ -2,8 +2,14 @@ // Distributed under 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) -#ifndef IMPLICIT_CAST_DWA200356_HPP -# define IMPLICIT_CAST_DWA200356_HPP + +#ifndef BOOST_IMPLICIT_CAST_DWA200356_HPP +#define BOOST_IMPLICIT_CAST_DWA200356_HPP + +#include <boost/config.hpp> +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif namespace boost { @@ -22,15 +28,11 @@ template<class T> struct icast_identity // The use of identity creates a non-deduced form, so that the // explicit template argument must be supplied template <typename T> -inline T implicit_cast (typename boost::detail::icast_identity<T>::type x) { +BOOST_CONSTEXPR inline T implicit_cast (typename boost::detail::icast_identity<T>::type x) { return x; } -// incomplete return type now is here -//template <typename T> -//void implicit_cast (...); - } // namespace boost -#endif // IMPLICIT_CAST_DWA200356_HPP +#endif // BOOST_IMPLICIT_CAST_DWA200356_HPP diff --git a/contrib/restricted/boost/conversion/include/boost/polymorphic_cast.hpp b/contrib/restricted/boost/conversion/include/boost/polymorphic_cast.hpp index 70afa6be2ee..35925060032 100644 --- a/contrib/restricted/boost/conversion/include/boost/polymorphic_cast.hpp +++ b/contrib/restricted/boost/conversion/include/boost/polymorphic_cast.hpp @@ -50,14 +50,20 @@ #define BOOST_POLYMORPHIC_CAST_HPP # include <boost/config.hpp> -# include <boost/assert.hpp> -# include <boost/throw_exception.hpp> -# include <typeinfo> #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif +# include <boost/assert.hpp> +# include <boost/core/addressof.hpp> +# include <boost/core/enable_if.hpp> +# include <boost/throw_exception.hpp> +# include <boost/type_traits/is_reference.hpp> +# include <boost/type_traits/remove_reference.hpp> + +# include <typeinfo> + namespace boost { // See the documentation for descriptions of how to choose between @@ -79,7 +85,7 @@ namespace boost // polymorphic_downcast ----------------------------------------------------// - // BOOST_ASSERT() checked polymorphic downcast. Crosscasts prohibited. + // BOOST_ASSERT() checked raw pointer polymorphic downcast. Crosscasts prohibited. // WARNING: Because this cast uses BOOST_ASSERT(), it violates // the One Definition Rule if used in multiple translation units @@ -95,6 +101,26 @@ namespace boost return static_cast<Target>(x); } + // BOOST_ASSERT() checked reference polymorphic downcast. Crosscasts prohibited. + + // WARNING: Because this cast uses BOOST_ASSERT(), it violates + // the One Definition Rule if used in multiple translation units + // where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER + // NDEBUG are defined inconsistently. + + // Contributed by Julien Delacroix + + template <class Target, class Source> + inline typename boost::enable_if_c< + boost::is_reference<Target>::value, Target + >::type polymorphic_downcast(Source& x) + { + typedef typename boost::remove_reference<Target>::type* target_pointer_type; + return *boost::polymorphic_downcast<target_pointer_type>( + boost::addressof(x) + ); + } + } // namespace boost #endif // BOOST_POLYMORPHIC_CAST_HPP |