diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 22:19:06 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 23:31:49 +0300 |
commit | f17f1bdca793e442a554f732ba8ee53104e25fa0 (patch) | |
tree | a04b2229b085a9f7a0083efae5bd25cd881cf1c5 | |
parent | 64b331444bc397072543295de983ec13b9bee989 (diff) | |
download | ydb-f17f1bdca793e442a554f732ba8ee53104e25fa0.tar.gz |
Update contrib/restricted/boost/ratio to 1.84.0
37 files changed, 172 insertions, 3263 deletions
diff --git a/.mapping.json b/.mapping.json index 2af7e2909b..cf18f26e59 100644 --- a/.mapping.json +++ b/.mapping.json @@ -1762,9 +1762,7 @@ "contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt":"", "contrib/restricted/boost/ratio/CMakeLists.txt":"", "contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt":"", - "contrib/restricted/boost/rational/CMakeLists.darwin-arm64.txt":"", "contrib/restricted/boost/rational/CMakeLists.darwin-x86_64.txt":"", - "contrib/restricted/boost/rational/CMakeLists.linux-aarch64.txt":"", "contrib/restricted/boost/rational/CMakeLists.linux-x86_64.txt":"", "contrib/restricted/boost/rational/CMakeLists.txt":"", "contrib/restricted/boost/rational/CMakeLists.windows-x86_64.txt":"", diff --git a/contrib/restricted/boost/CMakeLists.darwin-arm64.txt b/contrib/restricted/boost/CMakeLists.darwin-arm64.txt index c522e3b862..aaeb2e5646 100644 --- a/contrib/restricted/boost/CMakeLists.darwin-arm64.txt +++ b/contrib/restricted/boost/CMakeLists.darwin-arm64.txt @@ -56,7 +56,6 @@ add_subdirectory(program_options) add_subdirectory(random) add_subdirectory(range) add_subdirectory(ratio) -add_subdirectory(rational) add_subdirectory(regex) add_subdirectory(smart_ptr) add_subdirectory(static_assert) diff --git a/contrib/restricted/boost/CMakeLists.linux-aarch64.txt b/contrib/restricted/boost/CMakeLists.linux-aarch64.txt index c522e3b862..aaeb2e5646 100644 --- a/contrib/restricted/boost/CMakeLists.linux-aarch64.txt +++ b/contrib/restricted/boost/CMakeLists.linux-aarch64.txt @@ -56,7 +56,6 @@ add_subdirectory(program_options) add_subdirectory(random) add_subdirectory(range) add_subdirectory(ratio) -add_subdirectory(rational) add_subdirectory(regex) add_subdirectory(smart_ptr) add_subdirectory(static_assert) diff --git a/contrib/restricted/boost/chrono/include/boost/chrono/detail/is_evenly_divisible_by.hpp b/contrib/restricted/boost/chrono/include/boost/chrono/detail/is_evenly_divisible_by.hpp index 960a208a75..643b0b4f7d 100644 --- a/contrib/restricted/boost/chrono/include/boost/chrono/detail/is_evenly_divisible_by.hpp +++ b/contrib/restricted/boost/chrono/include/boost/chrono/detail/is_evenly_divisible_by.hpp @@ -8,18 +8,12 @@ #ifndef BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP #define BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP -#include <boost/chrono/config.hpp> - -#include <boost/mpl/logical.hpp> -#include <boost/ratio/detail/overflow_helpers.hpp> +#include <boost/ratio/detail/is_evenly_divisible_by.hpp> namespace boost { namespace chrono { namespace chrono_detail { -// template <class R1, class R2> -// struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 > -// {}; template <class R1, class R2> struct is_evenly_divisible_by : public boost::ratio_detail::is_evenly_divisible_by<R1, R2> {}; diff --git a/contrib/restricted/boost/chrono/include/boost/chrono/detail/requires_cxx11.hpp b/contrib/restricted/boost/chrono/include/boost/chrono/detail/requires_cxx11.hpp index 6f55ae4228..44c52803b7 100644 --- a/contrib/restricted/boost/chrono/include/boost/chrono/detail/requires_cxx11.hpp +++ b/contrib/restricted/boost/chrono/include/boost/chrono/detail/requires_cxx11.hpp @@ -16,7 +16,7 @@ defined(BOOST_NO_CXX11_HDR_CHRONO) || \ defined(BOOST_NO_CXX11_HDR_RATIO) -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Chrono 1.82 and will be removed in Boost.Chrono 1.84.") +BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Chrono 1.82 and was removed in Boost.Chrono 1.84.") #endif diff --git a/contrib/restricted/boost/chrono/include/boost/chrono/duration.hpp b/contrib/restricted/boost/chrono/include/boost/chrono/duration.hpp index 3659cc28ee..72a9451865 100644 --- a/contrib/restricted/boost/chrono/include/boost/chrono/duration.hpp +++ b/contrib/restricted/boost/chrono/include/boost/chrono/duration.hpp @@ -39,6 +39,7 @@ time2_demo contained this comment: #include <boost/mpl/logical.hpp> #include <boost/ratio/ratio.hpp> +#include <boost/ratio/detail/is_ratio.hpp> #include <boost/type_traits/common_type.hpp> #include <boost/type_traits/is_arithmetic.hpp> #include <boost/type_traits/is_convertible.hpp> diff --git a/contrib/restricted/boost/chrono/include/boost/chrono/io/duration_units.hpp b/contrib/restricted/boost/chrono/include/boost/chrono/io/duration_units.hpp index 1cf0f694cc..8438ad4577 100644 --- a/contrib/restricted/boost/chrono/include/boost/chrono/io/duration_units.hpp +++ b/contrib/restricted/boost/chrono/include/boost/chrono/io/duration_units.hpp @@ -10,6 +10,7 @@ #include <boost/chrono/config.hpp> #include <boost/ratio/ratio_io.hpp> +#include <boost/ratio/config.hpp> #include <boost/chrono/duration.hpp> #include <boost/chrono/io/duration_style.hpp> #include <boost/chrono/io/ios_base_state.hpp> diff --git a/contrib/restricted/boost/chrono/include/boost/chrono/system_clocks.hpp b/contrib/restricted/boost/chrono/include/boost/chrono/system_clocks.hpp index 3087311ffe..a808ca7c7d 100644 --- a/contrib/restricted/boost/chrono/include/boost/chrono/system_clocks.hpp +++ b/contrib/restricted/boost/chrono/include/boost/chrono/system_clocks.hpp @@ -63,6 +63,7 @@ TODO: #include <boost/chrono/time_point.hpp> #include <boost/chrono/detail/system.hpp> #include <boost/chrono/clock_string.hpp> +#include <boost/ratio/config.hpp> #include <ctime> diff --git a/contrib/restricted/boost/chrono/src/chrono.cpp b/contrib/restricted/boost/chrono/src/chrono.cpp index f500a796c8..cc6bc9f97e 100644 --- a/contrib/restricted/boost/chrono/src/chrono.cpp +++ b/contrib/restricted/boost/chrono/src/chrono.cpp @@ -6,10 +6,12 @@ // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt -// define BOOST_CHRONO_SOURCE so that <boost/filesystem/config.hpp> knows +// define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows // the library is being built (possibly exporting rather than importing code) -#define BOOST_CHRONO_SOURCE +#ifndef BOOST_CHRONO_SOURCE +# define BOOST_CHRONO_SOURCE +#endif #include <boost/chrono/detail/inlined/chrono.hpp> diff --git a/contrib/restricted/boost/chrono/src/process_cpu_clocks.cpp b/contrib/restricted/boost/chrono/src/process_cpu_clocks.cpp index c21cab3b8b..e6496cac43 100644 --- a/contrib/restricted/boost/chrono/src/process_cpu_clocks.cpp +++ b/contrib/restricted/boost/chrono/src/process_cpu_clocks.cpp @@ -12,7 +12,9 @@ // define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows // the library is being built (possibly exporting rather than importing code) -#define BOOST_CHRONO_SOURCE +#ifndef BOOST_CHRONO_SOURCE +# define BOOST_CHRONO_SOURCE +#endif #include <boost/chrono/detail/inlined/process_cpu_clocks.hpp> diff --git a/contrib/restricted/boost/chrono/src/thread_clock.cpp b/contrib/restricted/boost/chrono/src/thread_clock.cpp index c21b114c0d..c39c8049da 100644 --- a/contrib/restricted/boost/chrono/src/thread_clock.cpp +++ b/contrib/restricted/boost/chrono/src/thread_clock.cpp @@ -13,7 +13,9 @@ // define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows // the library is being built (possibly exporting rather than importing code) -#define BOOST_CHRONO_SOURCE +#ifndef BOOST_CHRONO_SOURCE +# define BOOST_CHRONO_SOURCE +#endif #include <boost/chrono/detail/inlined/thread_clock.hpp> diff --git a/contrib/restricted/boost/chrono/ya.make b/contrib/restricted/boost/chrono/ya.make index 1faca1f9c4..0bb9d82d02 100644 --- a/contrib/restricted/boost/chrono/ya.make +++ b/contrib/restricted/boost/chrono/ya.make @@ -10,9 +10,9 @@ LICENSE( LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.83.0) +VERSION(1.84.0) -ORIGINAL_SOURCE(https://github.com/boostorg/chrono/archive/boost-1.83.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/chrono/archive/boost-1.84.0.tar.gz) PEERDIR( contrib/restricted/boost/assert diff --git a/contrib/restricted/boost/mpl/include/boost/mpl/aux_/config/dependent_nttp.hpp b/contrib/restricted/boost/mpl/include/boost/mpl/aux_/config/dependent_nttp.hpp deleted file mode 100644 index 5c2e24dbbd..0000000000 --- a/contrib/restricted/boost/mpl/include/boost/mpl/aux_/config/dependent_nttp.hpp +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef BOOST_MPL_AUX_CONFIG_DEPENDENT_NTTP_HPP_INCLUDED -#define BOOST_MPL_AUX_CONFIG_DEPENDENT_NTTP_HPP_INCLUDED - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) -// -// See http://www.boost.org/libs/mpl for documentation. - -// $Id$ -// $Date$ -// $Revision$ - -#include <boost/mpl/aux_/config/gcc.hpp> -#include <boost/mpl/aux_/config/workaround.hpp> - -// GCC and EDG-based compilers incorrectly reject the following code: -// template< typename T, T n > struct a; -// template< typename T > struct b; -// template< typename T, T n > struct b< a<T,n> > {}; - -#if !defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && ( BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(300)) \ - || BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \ - ) - -# define BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC - -#endif - -#endif // BOOST_MPL_AUX_CONFIG_DEPENDENT_NTTP_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/CMakeLists.darwin-arm64.txt b/contrib/restricted/boost/ratio/CMakeLists.darwin-arm64.txt index 7171c49b08..be975de1e0 100644 --- a/contrib/restricted/boost/ratio/CMakeLists.darwin-arm64.txt +++ b/contrib/restricted/boost/ratio/CMakeLists.darwin-arm64.txt @@ -13,11 +13,4 @@ target_include_directories(restricted-boost-ratio INTERFACE ) target_link_libraries(restricted-boost-ratio INTERFACE contrib-libs-cxxsupp - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-mpl - restricted-boost-rational - restricted-boost-static_assert - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/ratio/CMakeLists.darwin-x86_64.txt b/contrib/restricted/boost/ratio/CMakeLists.darwin-x86_64.txt index 7171c49b08..be975de1e0 100644 --- a/contrib/restricted/boost/ratio/CMakeLists.darwin-x86_64.txt +++ b/contrib/restricted/boost/ratio/CMakeLists.darwin-x86_64.txt @@ -13,11 +13,4 @@ target_include_directories(restricted-boost-ratio INTERFACE ) target_link_libraries(restricted-boost-ratio INTERFACE contrib-libs-cxxsupp - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-mpl - restricted-boost-rational - restricted-boost-static_assert - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/ratio/CMakeLists.linux-aarch64.txt b/contrib/restricted/boost/ratio/CMakeLists.linux-aarch64.txt index 90cac9ef7a..f78ccb011e 100644 --- a/contrib/restricted/boost/ratio/CMakeLists.linux-aarch64.txt +++ b/contrib/restricted/boost/ratio/CMakeLists.linux-aarch64.txt @@ -14,11 +14,4 @@ target_include_directories(restricted-boost-ratio INTERFACE target_link_libraries(restricted-boost-ratio INTERFACE contrib-libs-linux-headers contrib-libs-cxxsupp - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-mpl - restricted-boost-rational - restricted-boost-static_assert - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt b/contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt index 90cac9ef7a..f78ccb011e 100644 --- a/contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt +++ b/contrib/restricted/boost/ratio/CMakeLists.linux-x86_64.txt @@ -14,11 +14,4 @@ target_include_directories(restricted-boost-ratio INTERFACE target_link_libraries(restricted-boost-ratio INTERFACE contrib-libs-linux-headers contrib-libs-cxxsupp - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-mpl - restricted-boost-rational - restricted-boost-static_assert - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt b/contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt index 7171c49b08..be975de1e0 100644 --- a/contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt +++ b/contrib/restricted/boost/ratio/CMakeLists.windows-x86_64.txt @@ -13,11 +13,4 @@ target_include_directories(restricted-boost-ratio INTERFACE ) target_link_libraries(restricted-boost-ratio INTERFACE contrib-libs-cxxsupp - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-mpl - restricted-boost-rational - restricted-boost-static_assert - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp index 1c3dd3c071..9b404f2fe3 100644 --- a/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp +++ b/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp @@ -9,93 +9,10 @@ #ifndef BOOST_RATIO_CONFIG_HPP #define BOOST_RATIO_CONFIG_HPP -#include <boost/ratio/detail/requires_cxx11.hpp> -#include <boost/config.hpp> -#include <boost/config/pragma_message.hpp> -#include <boost/cstdint.hpp> +// This header is no longer useful and is only retained for compatibility +#include <cstdint> -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -# if ! defined BOOST_NO_CXX11_U16STRING -# define BOOST_NO_CXX11_U16STRING -# endif -# if ! defined BOOST_NO_CXX11_U32STRING -# define BOOST_NO_CXX11_U32STRING -# endif -#endif +#define BOOST_RATIO_INTMAX_C INTMAX_C - -#if !defined BOOST_RATIO_VERSION -#define BOOST_RATIO_VERSION 2 -#else -#if BOOST_RATIO_VERSION!=1 && BOOST_RATIO_VERSION!=2 -#error "BOOST_RATIO_VERSION must be 1 or 2" -#endif -#endif - -#if BOOST_RATIO_VERSION==1 -#if ! defined BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 -#define BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 -#endif -#endif - -#if BOOST_RATIO_VERSION==2 -#if ! defined BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 -#define BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 -#endif -#endif - -#ifdef INTMAX_C -#define BOOST_RATIO_INTMAX_C(a) INTMAX_C(a) -#elif __cplusplus >= 201103L -#define BOOST_RATIO_INTMAX_C(a) a##LL -#else -#define BOOST_RATIO_INTMAX_C(a) a##L -#endif - -#ifdef UINTMAX_C -#define BOOST_RATIO_UINTMAX_C(a) UINTMAX_C(a) -#elif __cplusplus >= 201103L -#define BOOST_RATIO_UINTMAX_C(a) a##ULL -#else -#define BOOST_RATIO_UINTMAX_C(a) a##UL -#endif - -#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL) - - -#ifndef BOOST_NO_CXX11_STATIC_ASSERT -#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) -#elif defined(BOOST_RATIO_USES_STATIC_ASSERT) -#include <boost/static_assert.hpp> -#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND) -#elif defined(BOOST_RATIO_USES_MPL_ASSERT) -#include <boost/mpl/assert.hpp> -#include <boost/mpl/bool.hpp> -#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) \ - BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES) -#else -//~ #elif defined(BOOST_RATIO_USES_ARRAY_ASSERT) -#define BOOST_RATIO_CONCAT(A,B) A##B -#define BOOST_RATIO_NAME(A,B) BOOST_RATIO_CONCAT(A,B) -#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_RATIO_NAME(__boost_ratio_test_,__LINE__)[(CND)?1:-1] -//~ #define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) -#endif - -#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT) -#define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add" -#define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub" -#define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul" -#define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div" -#define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range" -#define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0" -#define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range" -#endif - -#if defined(BOOST_RATIO_EXTENSIONS) - -BOOST_PRAGMA_MESSAGE("Support for BOOST_RATIO_EXTENSIONS is deprecated and will be removed when Boost.Ratio is implemented in terms of <ratio>.") - -#endif - -#endif // header +#endif // #ifndef BOOST_RATIO_CONFIG_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/gcd_lcm.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/gcd_lcm.hpp new file mode 100644 index 0000000000..d22a91ad2a --- /dev/null +++ b/contrib/restricted/boost/ratio/include/boost/ratio/detail/gcd_lcm.hpp @@ -0,0 +1,53 @@ +#ifndef BOOST_RATIO_DETAIL_GCD_LCM_HPP +#define BOOST_RATIO_DETAIL_GCD_LCM_HPP + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include <type_traits> +#include <cstdint> + +namespace boost +{ +namespace ratio_detail +{ + +template<std::intmax_t A> struct abs_: std::integral_constant<std::intmax_t, A < 0? -A: A> +{ +}; + +template<> struct abs_<INTMAX_MIN>: std::integral_constant<std::intmax_t, INTMAX_MIN> +{ +}; + +template<std::intmax_t A, std::intmax_t B> struct gcd_: public gcd_<B, A % B> +{ +}; + +template<std::intmax_t A> struct gcd_<A, 0>: std::integral_constant<std::intmax_t, A> +{ +}; + +template<std::intmax_t A, std::intmax_t B> struct lcm_: std::integral_constant<std::intmax_t, (A / gcd_<A, B>::value) * B> +{ +}; + +template<> struct lcm_<0, 0>: std::integral_constant<std::intmax_t, 0> +{ +}; + +// + +template<std::intmax_t A, std::intmax_t B> struct gcd: abs_< gcd_<A, B>::value > +{ +}; + +template<std::intmax_t A, std::intmax_t B> struct lcm: abs_< lcm_<A, B>::value > +{ +}; + +} // namespace ratio_detail +} // namespace boost + +#endif // BOOST_RATIO_DETAIL_GCD_LCM_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_evenly_divisible_by.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_evenly_divisible_by.hpp new file mode 100644 index 0000000000..5421bd3975 --- /dev/null +++ b/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_evenly_divisible_by.hpp @@ -0,0 +1,32 @@ +#ifndef BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP +#define BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include <type_traits> +#include <cstdint> + +namespace boost +{ +namespace ratio_detail +{ + +template<std::intmax_t A, std::intmax_t B> struct is_evenly_divisible_by_: std::integral_constant<bool, A % B == 0> +{ +}; + +template<std::intmax_t A> struct is_evenly_divisible_by_<A, 0>: std::false_type +{ +}; + +template<class R1, class R2> struct is_evenly_divisible_by: std::integral_constant<bool, + is_evenly_divisible_by_<R1::num, R2::num>::value && is_evenly_divisible_by_<R2::den, R1::den>::value> +{ +}; + +} // namespace ratio_detail +} // namespace boost + +#endif // BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_ratio.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_ratio.hpp new file mode 100644 index 0000000000..c9edfd1673 --- /dev/null +++ b/contrib/restricted/boost/ratio/include/boost/ratio/detail/is_ratio.hpp @@ -0,0 +1,28 @@ +#ifndef BOOST_RATIO_DETAIL_IS_RATIO_HPP +#define BOOST_RATIO_DETAIL_IS_RATIO_HPP + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include <boost/ratio/ratio_fwd.hpp> +#include <type_traits> +#include <cstdint> + +namespace boost +{ +namespace ratio_detail +{ + +template<class T> struct is_ratio: std::false_type +{ +}; + +template<std::intmax_t A, std::intmax_t B> struct is_ratio< boost::ratio<A, B> >: std::true_type +{ +}; + +} // namespace ratio_detail +} // namespace boost + +#endif // BOOST_RATIO_DETAIL_IS_RATIO_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/abs.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/abs.hpp deleted file mode 100644 index 91545888a9..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/abs.hpp +++ /dev/null @@ -1,89 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// -// Copyright Vicente J. Botet Escriba 2010 -// -// 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) -// -// See http://www.boost.org/libs/mpl for documentation. -// -//////////////////////////////////////////////////////////////////// -#ifndef BOOST_MPL_ABS_HPP_INCLUDED -#define BOOST_MPL_ABS_HPP_INCLUDED - -#include <boost/mpl/integral_c.hpp> -#include <boost/mpl/aux_/na_spec.hpp> -#include <boost/mpl/aux_/lambda_support.hpp> -#include <boost/mpl/aux_/config/integral.hpp> -#include <boost/mpl/aux_/config/static_constant.hpp> - -#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && !defined(__CUDACC__) \ - && ( defined(BOOST_MSVC) \ - || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \ - ) - -# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2 - -#endif - -namespace boost { namespace mpl { - -template< typename Tag > struct abs_impl; - -template< typename T > struct abs_tag -{ - typedef typename T::tag type; -}; - -template< - typename BOOST_MPL_AUX_NA_PARAM(N) - > -struct abs - : abs_impl< - typename abs_tag<N>::type - >::template apply<N>::type -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1, abs, (N)) -}; - -BOOST_MPL_AUX_NA_SPEC(1, abs) - -template< - typename T - , T n1 - > -struct abs_c - : abs<integral_c<T,n1> > -{ -}; - -#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) -namespace aux { -template< typename T, T n > struct abs_wknd -{ - BOOST_STATIC_CONSTANT(T, value = (n < 0 ? -n : n)); - typedef integral_c<T,value> type; -}; -} -#endif - -template<> -struct abs_impl<integral_c_tag> -{ -#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) - template< typename N > struct apply - : aux::abs_wknd< typename N::value_type, N::value > -#else - template< typename N > struct apply - : integral_c< typename N::value_type, ((N::value < 0) ? (-N::value) : N::value ) > -#endif - { - }; -}; - -}} - -#endif // BOOST_MPL_ABS_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/gcd.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/gcd.hpp deleted file mode 100644 index 30ba1db91c..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/gcd.hpp +++ /dev/null @@ -1,124 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// -// Copyright Vicente J. Botet Escriba 2010 -// -// 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) -// -// See http://www.boost.org/libs/mpl for documentation. -// -//////////////////////////////////////////////////////////////////// -#ifndef BOOST_MPL_GCD_HPP_INCLUDED -#define BOOST_MPL_GCD_HPP_INCLUDED - -#include <boost/mpl/integral_c.hpp> -#include <boost/ratio/detail/mpl/abs.hpp> -#include <boost/mpl/aux_/largest_int.hpp> -#include <boost/mpl/aux_/na_spec.hpp> -#include <boost/mpl/aux_/lambda_support.hpp> -#include <boost/mpl/aux_/config/integral.hpp> -#include <boost/mpl/aux_/config/static_constant.hpp> -#include <boost/mpl/aux_/config/dependent_nttp.hpp> -#include <boost/cstdint.hpp> - -#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && !defined(__CUDACC__) \ - && ( defined(BOOST_MSVC) \ - || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \ - ) - -# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2 - -#endif - -namespace boost { namespace mpl { - -template< typename Tag1, typename Tag2 > struct gcd_impl; - -template< typename T > struct gcd_tag -{ - typedef typename T::tag type; -}; - -template< - typename BOOST_MPL_AUX_NA_PARAM(N1) - , typename BOOST_MPL_AUX_NA_PARAM(N2) - > -struct gcd - : gcd_impl< - typename gcd_tag<N1>::type - , typename gcd_tag<N2>::type - >::template apply<N1, N2>::type -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT(2, gcd, (N1, N2)) -}; - -BOOST_MPL_AUX_NA_SPEC(2, gcd) - -template< - typename T - , T n1 - , T n2 - > -struct gcd_c - : gcd<integral_c<T,n1>,integral_c<T,n2> > -{ -}; - -namespace aux { - - // Workaround for error: the type of partial specialization template parameter constant "n2" - // depends on another template parameter - // Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1] -#if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) - - template< typename T1, boost::intmax_t n1, bool n1_is_0 - , typename T2, boost::intmax_t n2, bool n2_is_0 > - struct gcd_aux - : gcd_aux<T2, n2, n2==0, T1, (n1 % n2), (n1 % n2)==0> - {}; - - template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2> - struct gcd_aux<T1, n1, false, T2, n2, true> : integral_c<T1, n1> - {}; - - template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2, bool C> - struct gcd_aux<T1, n1, true, T2, n2, C> : integral_c<T2, n2> - {}; - -#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) - - template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 > - struct gcd_aux - - : gcd_aux<T2, n2, n2==0, - typename aux::largest_int<T1, T2>::type, - //~ T1, - (n1 % n2), (n1 % n2)==0> - {}; - - template <typename T1, T1 n1, typename T2, T2 n2> - struct gcd_aux<T1, n1, false, T2, n2, true> : integral_c<T1, n1> - {}; - - template <typename T1, T1 n1, typename T2, T2 n2, bool C> - struct gcd_aux<T1, n1, true, T2, n2, C> : integral_c<T2, n2> - {}; -#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) -} - -template<> -struct gcd_impl<integral_c_tag, integral_c_tag> -{ - template< typename N1, typename N2 > struct apply - : abs<aux::gcd_aux< typename N1::value_type, N1::value, N1::value==0, - typename N2::value_type, N2::value, N2::value==0 > > - { - }; -}; - -}} - -#endif // BOOST_MPL_GCD_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/lcm.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/lcm.hpp deleted file mode 100644 index 1792660f06..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/lcm.hpp +++ /dev/null @@ -1,126 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// -// Copyright Vicente J. Botet Escriba 2010 -// -// 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) -// -// See http://www.boost.org/libs/mpl for documentation. -// -//////////////////////////////////////////////////////////////////// -#ifndef BOOST_MPL_LCM_HPP_INCLUDED -#define BOOST_MPL_LCM_HPP_INCLUDED - -#include <boost/mpl/integral_c.hpp> -#include <boost/ratio/detail/mpl/abs.hpp> -#include <boost/mpl/aux_/largest_int.hpp> -#include <boost/mpl/aux_/na_spec.hpp> -#include <boost/mpl/aux_/lambda_support.hpp> -#include <boost/mpl/aux_/config/integral.hpp> -#include <boost/mpl/aux_/config/static_constant.hpp> -#include <boost/mpl/aux_/config/dependent_nttp.hpp> -#include <boost/cstdint.hpp> - -#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && !defined(__CUDACC__) \ - && ( defined(BOOST_MSVC) \ - || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \ - ) - -# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2 - -#endif - -namespace boost { namespace mpl { - -template< typename Tag1, typename Tag2 > struct lcm_impl; - -template< typename T > struct lcm_tag -{ - typedef typename T::tag type; -}; - -template< - typename BOOST_MPL_AUX_NA_PARAM(N1) - , typename BOOST_MPL_AUX_NA_PARAM(N2) - > -struct lcm - : lcm_impl< - typename lcm_tag<N1>::type - , typename lcm_tag<N2>::type - >::template apply<N1, N2>::type -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT(2, lcm, (N1, N2)) -}; - -BOOST_MPL_AUX_NA_SPEC(2, lcm) - -template< - typename T - , T n1 - , T n2 - > -struct lcm_c - : lcm<integral_c<T,n1>,integral_c<T,n2> > -{ -}; - - -namespace aux { - // Workaround for error: the type of partial specialization template parameter constant "n2" - // depends on another template parameter - // Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1] - #if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) - template< typename T1, boost::intmax_t n1, bool n1_is_0 - , typename T2, boost::intmax_t n2, bool n2_is_0 > - struct lcm_aux - : abs<integral_c< typename aux::largest_int<T1, T2>::type, - ( n1 / gcd<integral_c<T1,n1>, integral_c<T2,n2> >::value * n2 ) - > > - {}; - - template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2> - struct lcm_aux<T1, n1, false, T2, n2, true> : integral_c<T2, 0> - {}; - - template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2, bool C> - struct lcm_aux<T1, n1, true, T2, n2, C> : integral_c<T1, 0> - {}; - - -#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) - - - template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 > - struct lcm_aux - - : abs<integral_c< typename aux::largest_int<T1, T2>::type, - ( n1 / gcd<integral_c<T1,n1>, integral_c<T2,n2> >::value * n2 ) - > > - {}; - - template <typename T1, T1 n1, typename T2, T2 n2> - struct lcm_aux<T1, n1, false, T2, n2, true> : integral_c<T2, 0> - {}; - - template <typename T1, T1 n1, typename T2, T2 n2, bool C> - struct lcm_aux<T1, n1, true, T2, n2, C> : integral_c<T1, 0> - {}; -#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC) -} - -template<> -struct lcm_impl<integral_c_tag, integral_c_tag> -{ - template< typename N1, typename N2 > struct apply - : abs<aux::lcm_aux< typename N1::value_type, N1::value, N1::value==0, - typename N2::value_type, N2::value, N2::value==0 > > - { - }; -}; - -}} - -#endif // BOOST_MPL_LCM_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/sign.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/sign.hpp deleted file mode 100644 index fa1c555348..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/mpl/sign.hpp +++ /dev/null @@ -1,89 +0,0 @@ -//////////////////////////////////////////////////////////////////// -// -// Copyright Vicente J. Botet Escriba 2010 -// -// 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) -// -// See http://www.boost.org/libs/mpl for documentation. -// -//////////////////////////////////////////////////////////////////// -#ifndef BOOST_MPL_SIGN_HPP_INCLUDED -#define BOOST_MPL_SIGN_HPP_INCLUDED - -#include <boost/mpl/integral_c.hpp> -#include <boost/mpl/aux_/na_spec.hpp> -#include <boost/mpl/aux_/lambda_support.hpp> -#include <boost/mpl/aux_/config/integral.hpp> -#include <boost/mpl/aux_/config/static_constant.hpp> - -#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) \ - && !defined(__CUDACC__) \ - && ( defined(BOOST_MSVC) \ - || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \ - ) - -# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2 - -#endif - -namespace boost { namespace mpl { - -template< typename Tag > struct sign_impl; - -template< typename T > struct sign_tag -{ - typedef typename T::tag type; -}; - -template< - typename BOOST_MPL_AUX_NA_PARAM(N) - > -struct sign - : sign_impl< - typename sign_tag<N>::type - >::template apply<N>::type -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1, sign, (N)) -}; - -BOOST_MPL_AUX_NA_SPEC(1, sign) - -template< - typename T - , T n1 - > -struct sign_c - : sign<integral_c<T,n1> > -{ -}; - -#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) -namespace aux { -template< typename T, T n > struct sign_wknd -{ - BOOST_STATIC_CONSTANT(T, value = (n == 0 ? 0 : (n < 0 ? -1 : 1))); - typedef integral_c<T,value> type; -}; -} -#endif - -template<> -struct sign_impl<integral_c_tag> -{ -#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) - template< typename N > struct apply - : aux::sign_wknd< typename N::value_type, N::value > -#else - template< typename N > struct apply - : integral_c< typename N::value_type, (N::value == 0 ? 0 : (N::value < 0 ? -1 : 1)) > -#endif - { - }; -}; - -}} - -#endif // BOOST_MPL_SIGN_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/overflow_helpers.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/overflow_helpers.hpp deleted file mode 100644 index ffaa603a65..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/overflow_helpers.hpp +++ /dev/null @@ -1,367 +0,0 @@ -// ratio.hpp ---------------------------------------------------------------// - -// Copyright 2008 Howard Hinnant -// Copyright 2008 Beman Dawes -// Copyright 2009 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - -/* - -This code was derived by Beman Dawes from Howard Hinnant's time2_demo prototype. -Many thanks to Howard for making his code available under the Boost license. -The original code was modified to conform to Boost conventions and to section -20.4 Compile-time rational arithmetic [ratio], of the C++ committee working -paper N2798. -See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf. - -time2_demo contained this comment: - - Much thanks to Andrei Alexandrescu, - Walter Brown, - Peter Dimov, - Jeff Garland, - Terry Golubiewski, - Daniel Krugler, - Anthony Williams. -*/ - -// The way overflow is managed for ratio_less is taken from llvm/libcxx/include/ratio - -#ifndef BOOST_RATIO_DETAIL_RATIO_OPERATIONS_HPP -#define BOOST_RATIO_DETAIL_RATIO_OPERATIONS_HPP - -#include <boost/ratio/config.hpp> -#include <boost/ratio/detail/mpl/abs.hpp> -#include <boost/ratio/detail/mpl/sign.hpp> -#include <cstdlib> -#include <climits> -#include <limits> -#include <boost/cstdint.hpp> -#include <boost/type_traits/integral_constant.hpp> -#include <boost/core/enable_if.hpp> -#include <boost/integer_traits.hpp> - -// -// We simply cannot include this header on gcc without getting copious warnings of the kind: -// -// boost/integer.hpp:77:30: warning: use of C99 long long integer constant -// -// And yet there is no other reasonable implementation, so we declare this a system header -// to suppress these warnings. -// -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif - -namespace boost -{ - -//----------------------------------------------------------------------------// -// helpers // -//----------------------------------------------------------------------------// - -namespace ratio_detail -{ - - template <boost::intmax_t X, boost::intmax_t Y, boost::intmax_t = mpl::sign_c<boost::intmax_t, Y>::value> - class br_add; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_add<X, Y, 1> - { - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - BOOST_RATIO_STATIC_ASSERT(X <= max - Y , BOOST_RATIO_OVERFLOW_IN_ADD, ()); - public: - static const boost::intmax_t value = X + Y; - }; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_add<X, Y, 0> - { - public: - static const boost::intmax_t value = X; - }; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_add<X, Y, -1> - { - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - BOOST_RATIO_STATIC_ASSERT(min - Y <= X, BOOST_RATIO_OVERFLOW_IN_ADD, ()); - public: - static const boost::intmax_t value = X + Y; - }; - - template <boost::intmax_t X, boost::intmax_t Y, boost::intmax_t = mpl::sign_c<boost::intmax_t, Y>::value> - class br_sub; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_sub<X, Y, 1> - { - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - BOOST_RATIO_STATIC_ASSERT(min + Y <= X, BOOST_RATIO_OVERFLOW_IN_SUB, ()); - public: - static const boost::intmax_t value = X - Y; - }; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_sub<X, Y, 0> - { - public: - static const boost::intmax_t value = X; - }; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_sub<X, Y, -1> - { - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - BOOST_RATIO_STATIC_ASSERT(X <= max + Y, BOOST_RATIO_OVERFLOW_IN_SUB, ()); - public: - static const boost::intmax_t value = X - Y; - }; - - template <boost::intmax_t X, boost::intmax_t Y> - class br_mul - { - static const boost::intmax_t nan = - boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - static const boost::intmax_t a_x = mpl::abs_c<boost::intmax_t, X>::value; - static const boost::intmax_t a_y = mpl::abs_c<boost::intmax_t, Y>::value; - - BOOST_RATIO_STATIC_ASSERT(X != nan, BOOST_RATIO_OVERFLOW_IN_MUL, ()); - BOOST_RATIO_STATIC_ASSERT(Y != nan, BOOST_RATIO_OVERFLOW_IN_MUL, ()); - BOOST_RATIO_STATIC_ASSERT(a_x <= max / a_y, BOOST_RATIO_OVERFLOW_IN_MUL, ()); - public: - static const boost::intmax_t value = X * Y; - }; - - template <boost::intmax_t Y> - class br_mul<0, Y> - { - public: - static const boost::intmax_t value = 0; - }; - - template <boost::intmax_t X> - class br_mul<X, 0> - { - public: - static const boost::intmax_t value = 0; - }; - - template <> - class br_mul<0, 0> - { - public: - static const boost::intmax_t value = 0; - }; - - // Not actually used but left here in case needed in future maintenance - template <boost::intmax_t X, boost::intmax_t Y> - class br_div - { - static const boost::intmax_t nan = boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); - static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; - static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; - - BOOST_RATIO_STATIC_ASSERT(X != nan, BOOST_RATIO_OVERFLOW_IN_DIV, ()); - BOOST_RATIO_STATIC_ASSERT(Y != nan, BOOST_RATIO_OVERFLOW_IN_DIV, ()); - BOOST_RATIO_STATIC_ASSERT(Y != 0, BOOST_RATIO_DIVIDE_BY_0, ()); - public: - static const boost::intmax_t value = X / Y; - }; - - // ratio arithmetic - template <class R1, class R2> struct ratio_add; - template <class R1, class R2> struct ratio_subtract; - template <class R1, class R2> struct ratio_multiply; - template <class R1, class R2> struct ratio_divide; - - template <class R1, class R2> - struct ratio_add - { - //The nested typedef type shall be a synonym for ratio<T1, T2>::type where T1 has the value R1::num * - //R2::den + R2::num * R1::den and T2 has the value R1::den * R2::den. - // As the preceding doesn't works because of overflow on boost::intmax_t we need something more elaborated. - private: - static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value; - static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; - public: - // No need to normalize as ratio_multiply is already normalized - typedef typename ratio_multiply - < - ratio<gcd_n1_n2, R1::den / gcd_d1_d2>, - ratio - < - boost::ratio_detail::br_add - < - boost::ratio_detail::br_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value, - boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value - >::value, - R2::den - > - >::type type; - }; - template <class R, boost::intmax_t D> - struct ratio_add<R, ratio<0,D> > - { - typedef R type; - }; - - template <class R1, class R2> - struct ratio_subtract - { - //The nested typedef type shall be a synonym for ratio<T1, T2>::type where T1 has the value - // R1::num *R2::den - R2::num * R1::den and T2 has the value R1::den * R2::den. - // As the preceding doesn't works because of overflow on boost::intmax_t we need something more elaborated. - private: - static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value; - static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; - public: - // No need to normalize as ratio_multiply is already normalized - typedef typename ratio_multiply - < - ratio<gcd_n1_n2, R1::den / gcd_d1_d2>, - ratio - < - boost::ratio_detail::br_sub - < - boost::ratio_detail::br_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value, - boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value - >::value, - R2::den - > - >::type type; - }; - - template <class R, boost::intmax_t D> - struct ratio_subtract<R, ratio<0,D> > - { - typedef R type; - }; - - template <class R1, class R2> - struct ratio_multiply - { - // The nested typedef type shall be a synonym for ratio<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type. - // As the preceding doesn't works because of overflow on boost::intmax_t we need something more elaborated. - private: - static const boost::intmax_t gcd_n1_d2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::den>::value; - static const boost::intmax_t gcd_d1_n2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::num>::value; - public: - typedef typename ratio - < - boost::ratio_detail::br_mul<R1::num / gcd_n1_d2, R2::num / gcd_d1_n2>::value, - boost::ratio_detail::br_mul<R2::den / gcd_n1_d2, R1::den / gcd_d1_n2>::value - >::type type; - }; - - template <class R1, class R2> - struct ratio_divide - { - // The nested typedef type shall be a synonym for ratio<R1::num * R2::den, R2::num * R1::den>::type. - // As the preceding doesn't works because of overflow on boost::intmax_t we need something more elaborated. - private: - static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value; - static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; - public: - typedef typename ratio - < - boost::ratio_detail::br_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value, - boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value - >::type type; - }; - template <class R1, class R2> - struct is_evenly_divisible_by - { - private: - static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value; - static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; - public: - typedef integral_constant<bool, - ((R2::num / gcd_n1_n2 ==1) && (R1::den / gcd_d1_d2)==1) - > type; - }; - - template <class T> - struct is_ratio : public boost::false_type - {}; - template <boost::intmax_t N, boost::intmax_t D> - struct is_ratio<ratio<N, D> > : public boost::true_type - {}; - - template <class R1, class R2, - boost::intmax_t Q1 = R1::num / R1::den, boost::intmax_t M1 = R1::num % R1::den, - boost::intmax_t Q2 = R2::num / R2::den, boost::intmax_t M2 = R2::num % R2::den> - struct ratio_less1 - { - static const bool value = Q1 < Q2; - }; - - template <class R1, class R2, boost::intmax_t Q> - struct ratio_less1<R1, R2, Q, 0, Q, 0> - { - static const bool value = false; - }; - - template <class R1, class R2, boost::intmax_t Q, boost::intmax_t M2> - struct ratio_less1<R1, R2, Q, 0, Q, M2> - { - static const bool value = true; - }; - - template <class R1, class R2, boost::intmax_t Q, boost::intmax_t M1> - struct ratio_less1<R1, R2, Q, M1, Q, 0> - { - static const bool value = false; - }; - - template <class R1, class R2, boost::intmax_t Q, boost::intmax_t M1, boost::intmax_t M2> - struct ratio_less1<R1, R2, Q, M1, Q, M2> - { - static const bool value = ratio_less1<ratio<R2::den, M2>, ratio<R1::den, M1> - >::value; - }; - - template < - class R1, - class R2, - boost::intmax_t S1 = mpl::sign_c<boost::intmax_t, R1::num>::value, - boost::intmax_t S2 = mpl::sign_c<boost::intmax_t, R2::num>::value -> - struct ratio_less - { - static const bool value = S1 < S2; - }; - - template <class R1, class R2> - struct ratio_less<R1, R2, 1LL, 1LL> - { - static const bool value = ratio_less1<R1, R2>::value; - }; - - template <class R1, class R2> - struct ratio_less<R1, R2, -1LL, -1LL> - { - static const bool value = ratio_less1<ratio<-R2::num, R2::den>, - ratio<-R1::num, R1::den> >::value; - }; - - -} // namespace ratio_detail - -} // namespace boost - -#endif // BOOST_RATIO_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/ratio_io.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/ratio_io.hpp deleted file mode 100644 index 636dbc22f8..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/ratio_io.hpp +++ /dev/null @@ -1,1342 +0,0 @@ -// ratio_io -// -// (C) Copyright Howard Hinnant -// (C) Copyright 2010 Vicente J. Botet Escriba -// Use, modification and distribution are 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). -// -// This code was adapted by Vicente from Howard Hinnant's experimental work -// on chrono i/o under lvm/libc++ to Boost - -#ifndef BOOST_RATIO_DETAIL_RATIO_IO_HPP -#define BOOST_RATIO_DETAIL_RATIO_IO_HPP - -/* - - ratio_io synopsis - -#include <ratio> -#include <string> - -namespace boost -{ - -template <class Ratio, class CharT> -struct ratio_string -{ - static basic_string<CharT> short_name(); - static basic_string<CharT> long_name(); -}; - -} // boost - -*/ - -#include <boost/config.hpp> -#include <boost/ratio/ratio.hpp> -#include <boost/type_traits/integral_constant.hpp> -#include <string> -#include <sstream> - -#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING) -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT -#undef BOOST_RATIO_HAS_UNICODE_SUPPORT -#endif -#else -#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1 -#endif - -namespace boost { - -//template <class Ratio> -//struct ratio_string_is_localizable : false_type {}; -//template <class Ratio> -//struct ratio_string_id : integral_constant<int,0> {}; - -template <class Ratio, class CharT> -struct ratio_string -{ - static std::basic_string<CharT> short_name() {return long_name();} - static std::basic_string<CharT> long_name(); - static std::basic_string<CharT> symbol() {return short_name();} - static std::basic_string<CharT> prefix() {return long_name();} -}; - -template <class Ratio, class CharT> -std::basic_string<CharT> -ratio_string<Ratio, CharT>::long_name() -{ - std::basic_ostringstream<CharT> os; - os << CharT('[') << Ratio::num << CharT('/') - << Ratio::den << CharT(']'); - return os.str(); -} - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -namespace ratio_detail { -template <class Ratio, class CharT> -struct ratio_string_static -{ - static std::string short_name() { - return std::basic_string<CharT>( - static_string::c_str< - typename ratio_static_string<Ratio, CharT>::short_name - >::value); - } - static std::string long_name() { - return std::basic_string<CharT>( - static_string::c_str< - typename ratio_static_string<Ratio, CharT>::long_name - >::value); - } - static std::basic_string<CharT> symbol() {return short_name();} - static std::basic_string<CharT> prefix() {return long_name();} -}; -} -#endif -// atto -//template <> -//struct ratio_string_is_localizable<atto> : true_type {}; -// -//template <> -//struct ratio_string_id<atto> : integral_constant<int,-18> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<atto, CharT> : - ratio_detail::ratio_string_static<atto,CharT> -{}; - -#else -template <> -struct ratio_string<atto, char> -{ - static std::string short_name() {return std::string(1, 'a');} - static std::string long_name() {return std::string("atto");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<atto, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'a');} - static std::u16string long_name() {return std::u16string(u"atto");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<atto, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'a');} - static std::u32string long_name() {return std::u32string(U"atto");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<atto, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'a');} - static std::wstring long_name() {return std::wstring(L"atto");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// femto - -//template <> -//struct ratio_string_is_localizable<femto> : true_type {}; -// -//template <> -//struct ratio_string_id<femto> : integral_constant<int,-15> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<femto, CharT> : - ratio_detail::ratio_string_static<femto,CharT> -{}; - -#else - -template <> -struct ratio_string<femto, char> -{ - static std::string short_name() {return std::string(1, 'f');} - static std::string long_name() {return std::string("femto");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<femto, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'f');} - static std::u16string long_name() {return std::u16string(u"femto");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<femto, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'f');} - static std::u32string long_name() {return std::u32string(U"femto");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<femto, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'f');} - static std::wstring long_name() {return std::wstring(L"femto");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// pico - -//template <> -//struct ratio_string_is_localizable<pico> : true_type {}; -// -//template <> -//struct ratio_string_id<pico> : integral_constant<int,-12> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<pico, CharT> : - ratio_detail::ratio_string_static<pico,CharT> -{}; - -#else -template <> -struct ratio_string<pico, char> -{ - static std::string short_name() {return std::string(1, 'p');} - static std::string long_name() {return std::string("pico");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<pico, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'p');} - static std::u16string long_name() {return std::u16string(u"pico");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<pico, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'p');} - static std::u32string long_name() {return std::u32string(U"pico");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<pico, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'p');} - static std::wstring long_name() {return std::wstring(L"pico");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// nano - -//template <> -//struct ratio_string_is_localizable<nano> : true_type {}; -// -//template <> -//struct ratio_string_id<nano> : integral_constant<int,-9> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<nano, CharT> : - ratio_detail::ratio_string_static<nano,CharT> -{}; - -#else -template <> -struct ratio_string<nano, char> -{ - static std::string short_name() {return std::string(1, 'n');} - static std::string long_name() {return std::string("nano");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<nano, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'n');} - static std::u16string long_name() {return std::u16string(u"nano");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<nano, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'n');} - static std::u32string long_name() {return std::u32string(U"nano");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<nano, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'n');} - static std::wstring long_name() {return std::wstring(L"nano");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// micro - -//template <> -//struct ratio_string_is_localizable<micro> : true_type {}; -// -//template <> -//struct ratio_string_id<micro> : integral_constant<int,-6> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<micro, CharT> : - ratio_detail::ratio_string_static<micro,CharT> -{}; - -#else -template <> -struct ratio_string<micro, char> -{ - static std::string short_name() {return std::string("\xC2\xB5");} - static std::string long_name() {return std::string("micro");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<micro, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'\xB5');} - static std::u16string long_name() {return std::u16string(u"micro");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<micro, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'\xB5');} - static std::u32string long_name() {return std::u32string(U"micro");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<micro, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'\xB5');} - static std::wstring long_name() {return std::wstring(L"micro");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// milli - -//template <> -//struct ratio_string_is_localizable<milli> : true_type {}; -// -//template <> -//struct ratio_string_id<milli> : integral_constant<int,-3> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<milli, CharT> : - ratio_detail::ratio_string_static<milli,CharT> -{}; - -#else -template <> -struct ratio_string<milli, char> -{ - static std::string short_name() {return std::string(1, 'm');} - static std::string long_name() {return std::string("milli");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<milli, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'm');} - static std::u16string long_name() {return std::u16string(u"milli");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<milli, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'm');} - static std::u32string long_name() {return std::u32string(U"milli");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<milli, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'm');} - static std::wstring long_name() {return std::wstring(L"milli");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// centi - -//template <> -//struct ratio_string_is_localizable<centi> : true_type {}; -// -//template <> -//struct ratio_string_id<centi> : integral_constant<int,-2> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<centi, CharT> : - ratio_detail::ratio_string_static<centi,CharT> -{}; - -#else -template <> -struct ratio_string<centi, char> -{ - static std::string short_name() {return std::string(1, 'c');} - static std::string long_name() {return std::string("centi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<centi, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'c');} - static std::u16string long_name() {return std::u16string(u"centi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<centi, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'c');} - static std::u32string long_name() {return std::u32string(U"centi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<centi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'c');} - static std::wstring long_name() {return std::wstring(L"centi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// deci - -//template <> -//struct ratio_string_is_localizable<deci> : true_type {}; -// -//template <> -//struct ratio_string_id<deci> : integral_constant<int,-1> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<deci, CharT> : - ratio_detail::ratio_string_static<deci,CharT> -{}; - -#else - -template <> -struct ratio_string<deci, char> -{ - static std::string short_name() {return std::string(1, 'd');} - static std::string long_name() {return std::string("deci");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<deci, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'd');} - static std::u16string long_name() {return std::u16string(u"deci");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<deci, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'd');} - static std::u32string long_name() {return std::u32string(U"deci");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<deci, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'd');} - static std::wstring long_name() {return std::wstring(L"deci");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// unit - -//template <> -//struct ratio_string_is_localizable<ratio<1> > : true_type {}; -// -//template <> -//struct ratio_string_id<ratio<1> > : integral_constant<int,0> {}; -// deca - -//template <> -//struct ratio_string_is_localizable<deca> : true_type {}; -// -//template <> -//struct ratio_string_id<deca> : integral_constant<int,1> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<deca, CharT> : - ratio_detail::ratio_string_static<deca,CharT> -{}; - -#else -template <> -struct ratio_string<deca, char> -{ - static std::string short_name() {return std::string("da");} - static std::string long_name() {return std::string("deca");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<deca, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"da");} - static std::u16string long_name() {return std::u16string(u"deca");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<deca, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"da");} - static std::u32string long_name() {return std::u32string(U"deca");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<deca, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"da");} - static std::wstring long_name() {return std::wstring(L"deca");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// hecto - -//template <> -//struct ratio_string_is_localizable<hecto> : true_type {}; -// -//template <> -//struct ratio_string_id<hecto> : integral_constant<int,2> {}; - - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<hecto, CharT> : - ratio_detail::ratio_string_static<hecto,CharT> -{}; - -#else -template <> -struct ratio_string<hecto, char> -{ - static std::string short_name() {return std::string(1, 'h');} - static std::string long_name() {return std::string("hecto");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<hecto, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'h');} - static std::u16string long_name() {return std::u16string(u"hecto");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<hecto, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'h');} - static std::u32string long_name() {return std::u32string(U"hecto");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<hecto, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'h');} - static std::wstring long_name() {return std::wstring(L"hecto");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// kilo - -//template <> -//struct ratio_string_is_localizable<kilo> : true_type {}; -// -//template <> -//struct ratio_string_id<kilo> : integral_constant<int,3> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<kilo, CharT> : - ratio_detail::ratio_string_static<kilo,CharT> -{}; - -#else -template <> -struct ratio_string<kilo, char> -{ - static std::string short_name() {return std::string(1, 'k');} - static std::string long_name() {return std::string("kilo");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<kilo, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'k');} - static std::u16string long_name() {return std::u16string(u"kilo");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<kilo, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'k');} - static std::u32string long_name() {return std::u32string(U"kilo");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<kilo, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'k');} - static std::wstring long_name() {return std::wstring(L"kilo");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// mega - -//template <> -//struct ratio_string_is_localizable<mega> : true_type {}; -// -//template <> -//struct ratio_string_id<mega> : integral_constant<int,6> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<mega, CharT> : - ratio_detail::ratio_string_static<mega,CharT> -{}; - -#else - -template <> -struct ratio_string<mega, char> -{ - static std::string short_name() {return std::string(1, 'M');} - static std::string long_name() {return std::string("mega");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<mega, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'M');} - static std::u16string long_name() {return std::u16string(u"mega");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<mega, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'M');} - static std::u32string long_name() {return std::u32string(U"mega");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<mega, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'M');} - static std::wstring long_name() {return std::wstring(L"mega");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// giga - -//template <> -//struct ratio_string_is_localizable<giga> : true_type {}; -// -//template <> -//struct ratio_string_id<giga> : integral_constant<int,9> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<giga, CharT> : - ratio_detail::ratio_string_static<giga,CharT> -{}; - -#else - -template <> -struct ratio_string<giga, char> -{ - static std::string short_name() {return std::string(1, 'G');} - static std::string long_name() {return std::string("giga");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<giga, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'G');} - static std::u16string long_name() {return std::u16string(u"giga");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<giga, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'G');} - static std::u32string long_name() {return std::u32string(U"giga");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<giga, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'G');} - static std::wstring long_name() {return std::wstring(L"giga");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// tera - -//template <> -//struct ratio_string_is_localizable<tera> : true_type {}; -// -//template <> -//struct ratio_string_id<tera> : integral_constant<int,12> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<tera, CharT> : - ratio_detail::ratio_string_static<tera,CharT> -{}; - -#else -template <> -struct ratio_string<tera, char> -{ - static std::string short_name() {return std::string(1, 'T');} - static std::string long_name() {return std::string("tera");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<tera, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'T');} - static std::u16string long_name() {return std::u16string(u"tera");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<tera, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'T');} - static std::u32string long_name() {return std::u32string(U"tera");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<tera, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'T');} - static std::wstring long_name() {return std::wstring(L"tera");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// peta - -//template <> -//struct ratio_string_is_localizable<peta> : true_type {}; -// -//template <> -//struct ratio_string_id<peta> : integral_constant<int,15> {}; - - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<peta, CharT> : - ratio_detail::ratio_string_static<peta,CharT> -{}; - -#else -template <> -struct ratio_string<peta, char> -{ - static std::string short_name() {return std::string(1, 'P');} - static std::string long_name() {return std::string("peta");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<peta, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'P');} - static std::u16string long_name() {return std::u16string(u"peta");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<peta, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'P');} - static std::u32string long_name() {return std::u32string(U"peta");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<peta, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'P');} - static std::wstring long_name() {return std::wstring(L"peta");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -// exa - -//template <> -//struct ratio_string_is_localizable<exa> : true_type {}; -// -//template <> -//struct ratio_string_id<exa> : integral_constant<int,18> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<exa, CharT> : - ratio_detail::ratio_string_static<exa,CharT> -{}; - -#else -template <> -struct ratio_string<exa, char> -{ - static std::string short_name() {return std::string(1, 'E');} - static std::string long_name() {return std::string("exa");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<exa, char16_t> -{ - static std::u16string short_name() {return std::u16string(1, u'E');} - static std::u16string long_name() {return std::u16string(u"exa");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<exa, char32_t> -{ - static std::u32string short_name() {return std::u32string(1, U'E');} - static std::u32string long_name() {return std::u32string(U"exa");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<exa, wchar_t> -{ - static std::wstring short_name() {return std::wstring(1, L'E');} - static std::wstring long_name() {return std::wstring(L"exa");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_EXTENSIONS - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<kibi, CharT> : - ratio_detail::ratio_string_static<kibi,CharT> -{}; - -#else -template <> -struct ratio_string<kibi, char> -{ - static std::string short_name() {return std::string("Ki");} - static std::string long_name() {return std::string("kibi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<kibi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Ki");} - static std::u16string long_name() {return std::u16string(u"kibi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<kibi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Ki");} - static std::u32string long_name() {return std::u32string(U"kibi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<kibi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Ki");} - static std::wstring long_name() {return std::wstring(L"kibi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<mebi, CharT> : - ratio_detail::ratio_string_static<mebi,CharT> -{}; - -#else -template <> -struct ratio_string<mebi, char> -{ - static std::string short_name() {return std::string("Mi");} - static std::string long_name() {return std::string("mebi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<mebi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Mi");} - static std::u16string long_name() {return std::u16string(u"mebi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<mebi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Mi");} - static std::u32string long_name() {return std::u32string(U"mebi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<mebi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Mi");} - static std::wstring long_name() {return std::wstring(L"mebi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<gibi, CharT> : - ratio_detail::ratio_string_static<gibi,CharT> -{}; - -#else -template <> -struct ratio_string<gibi, char> -{ - static std::string short_name() {return std::string("Gi");} - static std::string long_name() {return std::string("gibi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<gibi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Gi");} - static std::u16string long_name() {return std::u16string(u"gibi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<gibi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Gi");} - static std::u32string long_name() {return std::u32string(U"gibi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<gibi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Gi");} - static std::wstring long_name() {return std::wstring(L"gibi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<tebi, CharT> : - ratio_detail::ratio_string_static<tebi,CharT> -{}; - -#else -template <> -struct ratio_string<tebi, char> -{ - static std::string short_name() {return std::string("Ti");} - static std::string long_name() {return std::string("tebi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<tebi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Ti");} - static std::u16string long_name() {return std::u16string(u"tebi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<tebi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Ti");} - static std::u32string long_name() {return std::u32string(U"tebi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<tebi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Ti");} - static std::wstring long_name() {return std::wstring(L"tebi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<pebi, CharT> : - ratio_detail::ratio_string_static<pebi,CharT> -{}; - -#else -template <> -struct ratio_string<pebi, char> -{ - static std::string short_name() {return std::string("Pi");} - static std::string long_name() {return std::string("pebi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<pebi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Pi");} - static std::u16string long_name() {return std::u16string(u"pebi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<pebi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Pi");} - static std::u32string long_name() {return std::u32string(U"pebi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<pebi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Pi");} - static std::wstring long_name() {return std::wstring(L"pebi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<exbi, CharT> : - ratio_detail::ratio_string_static<exbi,CharT> -{}; - -#else -template <> -struct ratio_string<exbi, char> -{ - static std::string short_name() {return std::string("Ei");} - static std::string long_name() {return std::string("exbi");} - static std::string symbol() {return short_name();} - static std::string prefix() {return long_name();} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<exbi, char16_t> -{ - static std::u16string short_name() {return std::u16string(u"Ei");} - static std::u16string long_name() {return std::u16string(u"exbi");} - static std::u16string symbol() {return short_name();} - static std::u16string prefix() {return long_name();} -}; - -template <> -struct ratio_string<exbi, char32_t> -{ - static std::u32string short_name() {return std::u32string(U"Ei");} - static std::u32string long_name() {return std::u32string(U"exbi");} - static std::u32string symbol() {return short_name();} - static std::u32string prefix() {return long_name();} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<exbi, wchar_t> -{ - static std::wstring short_name() {return std::wstring(L"Ei");} - static std::wstring long_name() {return std::wstring(L"exbi");} - static std::wstring symbol() {return short_name();} - static std::wstring prefix() {return long_name();} -}; -#endif -#endif -#endif -} - -#endif // BOOST_RATIO_RATIO_IO_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/detail/requires_cxx11.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/detail/requires_cxx11.hpp deleted file mode 100644 index 1f7362e6de..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/detail/requires_cxx11.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BOOST_RATIO_DETAIL_REQUIRES_CXX11_HPP_INCLUDED -#define BOOST_RATIO_DETAIL_REQUIRES_CXX11_HPP_INCLUDED - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include <boost/config.hpp> -#include <boost/config/pragma_message.hpp> - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ - defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_DECLTYPE) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_HDR_RATIO) - -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Ratio 1.82 and will be removed in Boost.Ratio 1.84.") - -#endif - -#endif // #ifndef BOOST_RATIO_DETAIL_REQUIRES_CXX11_HPP_INCLUDED diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/mpl/rational_c_tag.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/mpl/rational_c_tag.hpp deleted file mode 100644 index 743766ffa0..0000000000 --- a/contrib/restricted/boost/ratio/include/boost/ratio/mpl/rational_c_tag.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// abs.hpp -// -// (C) Copyright 2011 Vicente J. Botet Escriba -// Use, modification and distribution are 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). -// - -#ifndef BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP -#define BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP - -#ifdef BOOST_RATIO_EXTENSIONS - -#include <boost/mpl/int.hpp> - -namespace boost { -namespace mpl { - -struct rational_c_tag : int_<10> {}; - -} -} - -#endif // BOOST_RATIO_EXTENSIONS -#endif // BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/ratio.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/ratio.hpp index 824cbf0173..e670763788 100644 --- a/contrib/restricted/boost/ratio/include/boost/ratio/ratio.hpp +++ b/contrib/restricted/boost/ratio/include/boost/ratio/ratio.hpp @@ -32,262 +32,18 @@ time2_demo contained this comment: #ifndef BOOST_RATIO_RATIO_HPP #define BOOST_RATIO_RATIO_HPP -#include <boost/ratio/config.hpp> -#include <boost/ratio/detail/mpl/abs.hpp> -#include <boost/ratio/detail/mpl/sign.hpp> -#include <boost/ratio/detail/mpl/gcd.hpp> -#include <boost/ratio/detail/mpl/lcm.hpp> -#include <cstdlib> -#include <climits> -#include <limits> -#include <boost/cstdint.hpp> -#include <boost/type_traits/integral_constant.hpp> -#include <boost/core/enable_if.hpp> -#include <boost/integer_traits.hpp> #include <boost/ratio/ratio_fwd.hpp> -#include <boost/ratio/detail/overflow_helpers.hpp> -#ifdef BOOST_RATIO_EXTENSIONS -#include <boost/rational.hpp> -#include <boost/ratio/mpl/rational_c_tag.hpp> -#endif - -// -// We simply cannot include this header on gcc without getting copious warnings of the kind: -// -// boost/integer.hpp:77:30: warning: use of C99 long long integer constant -// -// And yet there is no other reasonable implementation, so we declare this a system header -// to suppress these warnings. -// -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +#include <boost/ratio/detail/gcd_lcm.hpp> namespace boost { +// extension used by Chrono -//----------------------------------------------------------------------------// -// // -// 20.6.1 Class template ratio [ratio.ratio] // -// // -//----------------------------------------------------------------------------// - -template <boost::intmax_t N, boost::intmax_t D> -class ratio -{ - static const boost::intmax_t ABS_N = mpl::abs_c<boost::intmax_t, N>::value; - static const boost::intmax_t ABS_D = mpl::abs_c<boost::intmax_t, D>::value; - BOOST_RATIO_STATIC_ASSERT(ABS_N >= 0, BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE, ()); - BOOST_RATIO_STATIC_ASSERT(ABS_D > 0, BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE, ()); - BOOST_RATIO_STATIC_ASSERT(D != 0, BOOST_RATIO_DIVIDE_BY_0 , ()); - static const boost::intmax_t SIGN_N = mpl::sign_c<boost::intmax_t,N>::value - * mpl::sign_c<boost::intmax_t,D>::value; - static const boost::intmax_t GCD = mpl::gcd_c<boost::intmax_t, ABS_N, ABS_D>::value; -public: - BOOST_STATIC_CONSTEXPR boost::intmax_t num = SIGN_N * ABS_N / GCD; - BOOST_STATIC_CONSTEXPR boost::intmax_t den = ABS_D / GCD; - -#ifdef BOOST_RATIO_EXTENSIONS - typedef mpl::rational_c_tag tag; - typedef boost::rational<boost::intmax_t> value_type; - typedef boost::intmax_t num_type; - typedef boost::intmax_t den_type; - ratio() - {} - template <boost::intmax_t _N2, boost::intmax_t _D2> - ratio(const ratio<_N2, _D2>&, - typename enable_if_c - < - (ratio<_N2, _D2>::num == num && - ratio<_N2, _D2>::den == den) - >::type* = 0) - {} - - template <boost::intmax_t _N2, boost::intmax_t _D2> - typename enable_if_c - < - (ratio<_N2, _D2>::num == num && - ratio<_N2, _D2>::den == den), - ratio& - >::type - operator=(const ratio<_N2, _D2>&) {return *this;} - - static value_type value() {return value_type(num,den);} - value_type operator()() const {return value();} -#endif - typedef ratio<num, den> type; -}; - -#if defined(BOOST_NO_CXX11_CONSTEXPR) -template <boost::intmax_t N, boost::intmax_t D> -const boost::intmax_t ratio<N, D>::num; -template <boost::intmax_t N, boost::intmax_t D> -const boost::intmax_t ratio<N, D>::den; -#endif - -//----------------------------------------------------------------------------// -// // -// 20.6.2 Arithmetic on ratio types [ratio.arithmetic] // -// // -//----------------------------------------------------------------------------// - -template <class R1, class R2> -struct ratio_add -: boost::ratio_detail::ratio_add<R1, R2>::type -{ -}; - -template <class R1, class R2> -struct ratio_subtract -: boost::ratio_detail::ratio_subtract<R1, R2>::type -{ -}; - -template <class R1, class R2> -struct ratio_multiply -: boost::ratio_detail::ratio_multiply<R1, R2>::type -{ -}; - -template <class R1, class R2> -struct ratio_divide -: boost::ratio_detail::ratio_divide<R1, R2>::type -{ -}; - -//----------------------------------------------------------------------------// -// // -// 20.6.3 Comparision of ratio types [ratio.comparison] // -// // -//----------------------------------------------------------------------------// - -// ratio_equal - -template <class R1, class R2> -struct ratio_equal - : public boost::integral_constant<bool, - (R1::num == R2::num && R1::den == R2::den)> -{}; - -template <class R1, class R2> -struct ratio_not_equal - : public boost::integral_constant<bool, !ratio_equal<R1, R2>::value> -{}; - -// ratio_less - -template <class R1, class R2> -struct ratio_less - : boost::integral_constant<bool, boost::ratio_detail::ratio_less<R1, R2>::value> -{}; - -template <class R1, class R2> -struct ratio_less_equal - : boost::integral_constant<bool, !ratio_less<R2, R1>::value> -{}; - -template <class R1, class R2> -struct ratio_greater - : boost::integral_constant<bool, ratio_less<R2, R1>::value> -{}; - -template <class R1, class R2> -struct ratio_greater_equal - : boost::integral_constant<bool, !ratio_less<R1, R2>::value> -{}; - -template <class R1, class R2> -struct ratio_gcd : - ratio<mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value, - mpl::lcm_c<boost::intmax_t, R1::den, R2::den>::value>::type -{ -}; - - //----------------------------------------------------------------------------// - // // - // More arithmetic on ratio types [ratio.arithmetic] // - // // - //----------------------------------------------------------------------------// - -#ifdef BOOST_RATIO_EXTENSIONS -template <class R> -struct ratio_negate - : ratio<-R::num, R::den>::type -{ -}; -template <class R> -struct ratio_abs - : ratio<mpl::abs_c<boost::intmax_t, R::num>::value, R::den>::type -{ -}; -template <class R> -struct ratio_sign - : mpl::sign_c<boost::intmax_t, R::num> -{ -}; +template <class R1, class R2> using ratio_gcd = typename ratio< + ratio_detail::gcd<R1::num, R2::num>::value, + ratio_detail::lcm<R1::den, R2::den>::value>::type; -template <class R> -struct ratio_inverse - : ratio<R::den, R::num>::type -{ -}; - - -template <class R1, class R2> -struct ratio_lcm : - ratio<mpl::lcm_c<boost::intmax_t, R1::num, R2::num>::value, - mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value>::type -{ -}; - -template <class R1, class R2> -struct ratio_modulo : - ratio<(R1::num * R2::den) % (R2::num * R1::den), R1::den * R2::den>::type -{ -}; - -namespace detail { - template <class R1, class R2, bool r1ltr2> - struct ratio_min : R1 {}; - template <class R1, class R2> - struct ratio_min<R1,R2,false> : R2 {}; - - template <class R1, class R2, bool r1ltr2> - struct ratio_max : R2 {}; - template <class R1, class R2> - struct ratio_max<R1,R2,false> : R1 {}; -} - -template <class R1, class R2> -struct ratio_min : detail::ratio_min<R1, R2, ratio_less<R1,R2>::value>::type -{ -}; - -template <class R1, class R2> -struct ratio_max : detail::ratio_max<R1, R2, ratio_less<R1,R2>::value>::type -{ -}; - -template<typename R, int p> -struct ratio_power : - ratio_multiply< - typename ratio_power<R, p%2>::type, - typename ratio_power<typename ratio_multiply<R, R>::type, p/2>::type - >::type -{}; - -template<typename R> -struct ratio_power<R, 0> : ratio<1>::type {}; - -template<typename R> -struct ratio_power<R, 1> : R {}; - -template<typename R> -struct ratio_power<R, -1> : ratio_divide<ratio<1>, R>::type {}; - -#endif } // namespace boost - #endif // BOOST_RATIO_RATIO_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/ratio_fwd.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/ratio_fwd.hpp index cd9199f393..a044c9b63c 100644 --- a/contrib/restricted/boost/ratio/include/boost/ratio/ratio_fwd.hpp +++ b/contrib/restricted/boost/ratio/include/boost/ratio/ratio_fwd.hpp @@ -32,11 +32,7 @@ time2_demo contained this comment: #ifndef BOOST_RATIO_RATIO_FWD_HPP #define BOOST_RATIO_RATIO_FWD_HPP -#include <boost/ratio/config.hpp> - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +#include <ratio> namespace boost { @@ -48,62 +44,40 @@ namespace boost //----------------------------------------------------------------------------// // ratio -template <boost::intmax_t N, boost::intmax_t D = 1> class ratio; +using std::ratio; // ratio arithmetic -template <class R1, class R2> struct ratio_add; -template <class R1, class R2> struct ratio_subtract; -template <class R1, class R2> struct ratio_multiply; -template <class R1, class R2> struct ratio_divide; -#ifdef BOOST_RATIO_EXTENSIONS -template <class R1, class R2> struct ratio_gcd; -template <class R1, class R2> struct ratio_lcm; -template <class R> struct ratio_negate; -template <class R> struct ratio_abs; -template <class R> struct ratio_sign; -template <class R, int P> struct ratio_power; -#endif +using std::ratio_add; +using std::ratio_subtract; +using std::ratio_multiply; +using std::ratio_divide; // ratio comparison -template <class R1, class R2> struct ratio_equal; -template <class R1, class R2> struct ratio_not_equal; -template <class R1, class R2> struct ratio_less; -template <class R1, class R2> struct ratio_less_equal; -template <class R1, class R2> struct ratio_greater; -template <class R1, class R2> struct ratio_greater_equal; +using std::ratio_equal; +using std::ratio_not_equal; +using std::ratio_less; +using std::ratio_less_equal; +using std::ratio_greater; +using std::ratio_greater_equal; // convenience SI typedefs -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000000000000000000)> atto; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000000000000000)> femto; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000000000000)> pico; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000000000)> nano; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000000)> micro; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(1000)> milli; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(100)> centi; -typedef ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(10)> deci; -typedef ratio< BOOST_RATIO_INTMAX_C(10), BOOST_RATIO_INTMAX_C(1)> deca; -typedef ratio< BOOST_RATIO_INTMAX_C(100), BOOST_RATIO_INTMAX_C(1)> hecto; -typedef ratio< BOOST_RATIO_INTMAX_C(1000), BOOST_RATIO_INTMAX_C(1)> kilo; -typedef ratio< BOOST_RATIO_INTMAX_C(1000000), BOOST_RATIO_INTMAX_C(1)> mega; -typedef ratio< BOOST_RATIO_INTMAX_C(1000000000), BOOST_RATIO_INTMAX_C(1)> giga; -typedef ratio< BOOST_RATIO_INTMAX_C(1000000000000), BOOST_RATIO_INTMAX_C(1)> tera; -typedef ratio< BOOST_RATIO_INTMAX_C(1000000000000000), BOOST_RATIO_INTMAX_C(1)> peta; -typedef ratio<BOOST_RATIO_INTMAX_C(1000000000000000000), BOOST_RATIO_INTMAX_C(1)> exa; - -#ifdef BOOST_RATIO_EXTENSIONS - -#define BOOST_RATIO_1024 BOOST_RATIO_INTMAX_C(1024) - -// convenience IEC typedefs -typedef ratio< BOOST_RATIO_1024> kibi; -typedef ratio< BOOST_RATIO_1024*BOOST_RATIO_1024> mebi; -typedef ratio< BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024> gibi; -typedef ratio< BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024> tebi; -typedef ratio< BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024> pebi; -typedef ratio<BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024*BOOST_RATIO_1024> exbi; - -#endif -} // namespace boost +using std::atto; +using std::femto; +using std::pico; +using std::nano; +using std::micro; +using std::milli; +using std::centi; +using std::deci; +using std::deca; +using std::hecto; +using std::kilo; +using std::mega; +using std::giga; +using std::tera; +using std::peta; +using std::exa; +} // namespace boost -#endif // BOOST_RATIO_HPP +#endif // BOOST_RATIO_RATIO_FWD_HPP diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/ratio_io.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/ratio_io.hpp index e39cbaffa5..e9da8ddcdf 100644 --- a/contrib/restricted/boost/ratio/include/boost/ratio/ratio_io.hpp +++ b/contrib/restricted/boost/ratio/include/boost/ratio/ratio_io.hpp @@ -32,34 +32,13 @@ struct ratio_string } // boost */ -#include <boost/ratio/config.hpp> -#ifdef BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 -#include <boost/ratio/detail/ratio_io.hpp> -#else - -#include <boost/config.hpp> #include <boost/ratio/ratio.hpp> -#include <boost/type_traits/integral_constant.hpp> #include <string> #include <sstream> - -#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING) -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT -#undef BOOST_RATIO_HAS_UNICODE_SUPPORT -#endif -#else -#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1 -#endif - namespace boost { -//template <class Ratio> -//struct ratio_string_is_localizable : false_type {}; -//template <class Ratio> -//struct ratio_string_id : integral_constant<int,0> {}; - template <class Ratio, class CharT> struct ratio_string { @@ -77,40 +56,8 @@ ratio_string<Ratio, CharT>::prefix() return os.str(); } -#ifdef BOOST_RATIO_HAS_STATIC_STRING -namespace ratio_detail { -template <class Ratio, class CharT> -struct ratio_string_static -{ - static std::string symbol() { - return std::basic_string<CharT>( - static_string::c_str< - typename ratio_static_string<Ratio, CharT>::symbol - >::value); - } - static std::string prefix() { - return std::basic_string<CharT>( - static_string::c_str< - typename ratio_static_string<Ratio, CharT>::prefix - >::value); - } -}; -} -#endif // atto -//template <> -//struct ratio_string_is_localizable<atto> : true_type {}; -// -//template <> -//struct ratio_string_id<atto> : integral_constant<int,-18> {}; - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<atto, CharT> : - ratio_detail::ratio_string_static<atto,CharT> -{}; -#else template <> struct ratio_string<atto, char> { @@ -118,8 +65,6 @@ struct ratio_string<atto, char> static std::string prefix() {return std::string("atto");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<atto, char16_t> { @@ -134,28 +79,15 @@ struct ratio_string<atto, char32_t> static std::u32string prefix() {return std::u32string(U"atto");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<atto, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'a');} static std::wstring prefix() {return std::wstring(L"atto");} }; -#endif -#endif // femto -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<femto, CharT> : - ratio_detail::ratio_string_static<femto,CharT> -{}; - -#else - template <> struct ratio_string<femto, char> { @@ -163,8 +95,6 @@ struct ratio_string<femto, char> static std::string prefix() {return std::string("femto");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<femto, char16_t> { @@ -179,27 +109,15 @@ struct ratio_string<femto, char32_t> static std::u32string prefix() {return std::u32string(U"femto");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<femto, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'f');} static std::wstring prefix() {return std::wstring(L"femto");} }; -#endif -#endif // pico -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<pico, CharT> : - ratio_detail::ratio_string_static<pico,CharT> -{}; - -#else template <> struct ratio_string<pico, char> { @@ -207,8 +125,6 @@ struct ratio_string<pico, char> static std::string prefix() {return std::string("pico");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<pico, char16_t> { @@ -223,27 +139,15 @@ struct ratio_string<pico, char32_t> static std::u32string prefix() {return std::u32string(U"pico");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<pico, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'p');} static std::wstring prefix() {return std::wstring(L"pico");} }; -#endif -#endif // nano -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<nano, CharT> : - ratio_detail::ratio_string_static<nano,CharT> -{}; - -#else template <> struct ratio_string<nano, char> { @@ -251,8 +155,6 @@ struct ratio_string<nano, char> static std::string prefix() {return std::string("nano");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<nano, char16_t> { @@ -267,27 +169,15 @@ struct ratio_string<nano, char32_t> static std::u32string prefix() {return std::u32string(U"nano");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<nano, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'n');} static std::wstring prefix() {return std::wstring(L"nano");} }; -#endif -#endif // micro -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<micro, CharT> : - ratio_detail::ratio_string_static<micro,CharT> -{}; - -#else template <> struct ratio_string<micro, char> { @@ -295,8 +185,6 @@ struct ratio_string<micro, char> static std::string prefix() {return std::string("micro");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<micro, char16_t> { @@ -311,27 +199,15 @@ struct ratio_string<micro, char32_t> static std::u32string prefix() {return std::u32string(U"micro");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<micro, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'\xB5');} static std::wstring prefix() {return std::wstring(L"micro");} }; -#endif -#endif // milli -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<milli, CharT> : - ratio_detail::ratio_string_static<milli,CharT> -{}; - -#else template <> struct ratio_string<milli, char> { @@ -339,8 +215,6 @@ struct ratio_string<milli, char> static std::string prefix() {return std::string("milli");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<milli, char16_t> { @@ -355,27 +229,15 @@ struct ratio_string<milli, char32_t> static std::u32string prefix() {return std::u32string(U"milli");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<milli, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'm');} static std::wstring prefix() {return std::wstring(L"milli");} }; -#endif -#endif // centi -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<centi, CharT> : - ratio_detail::ratio_string_static<centi,CharT> -{}; - -#else template <> struct ratio_string<centi, char> { @@ -383,8 +245,6 @@ struct ratio_string<centi, char> static std::string prefix() {return std::string("centi");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<centi, char16_t> { @@ -399,28 +259,15 @@ struct ratio_string<centi, char32_t> static std::u32string prefix() {return std::u32string(U"centi");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<centi, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'c');} static std::wstring prefix() {return std::wstring(L"centi");} }; -#endif -#endif // deci -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<deci, CharT> : - ratio_detail::ratio_string_static<deci,CharT> -{}; - -#else - template <> struct ratio_string<deci, char> { @@ -428,8 +275,6 @@ struct ratio_string<deci, char> static std::string prefix() {return std::string("deci");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<deci, char16_t> { @@ -444,30 +289,17 @@ struct ratio_string<deci, char32_t> static std::u32string prefix() {return std::u32string(U"deci");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<deci, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'd');} static std::wstring prefix() {return std::wstring(L"deci");} }; -#endif -#endif // unit // deca - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<deca, CharT> : - ratio_detail::ratio_string_static<deca,CharT> -{}; - -#else template <> struct ratio_string<deca, char> { @@ -475,8 +307,6 @@ struct ratio_string<deca, char> static std::string prefix() {return std::string("deca");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<deca, char16_t> { @@ -491,27 +321,15 @@ struct ratio_string<deca, char32_t> static std::u32string prefix() {return std::u32string(U"deca");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<deca, wchar_t> { static std::wstring symbol() {return std::wstring(L"da");} static std::wstring prefix() {return std::wstring(L"deca");} }; -#endif -#endif // hecto -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<hecto, CharT> : - ratio_detail::ratio_string_static<hecto,CharT> -{}; - -#else template <> struct ratio_string<hecto, char> { @@ -519,8 +337,6 @@ struct ratio_string<hecto, char> static std::string prefix() {return std::string("hecto");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<hecto, char16_t> { @@ -535,27 +351,15 @@ struct ratio_string<hecto, char32_t> static std::u32string prefix() {return std::u32string(U"hecto");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<hecto, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'h');} static std::wstring prefix() {return std::wstring(L"hecto");} }; -#endif -#endif // kilo -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<kilo, CharT> : - ratio_detail::ratio_string_static<kilo,CharT> -{}; - -#else template <> struct ratio_string<kilo, char> { @@ -563,8 +367,6 @@ struct ratio_string<kilo, char> static std::string prefix() {return std::string("kilo");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<kilo, char16_t> { @@ -579,28 +381,15 @@ struct ratio_string<kilo, char32_t> static std::u32string prefix() {return std::u32string(U"kilo");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<kilo, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'k');} static std::wstring prefix() {return std::wstring(L"kilo");} }; -#endif -#endif // mega -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<mega, CharT> : - ratio_detail::ratio_string_static<mega,CharT> -{}; - -#else - template <> struct ratio_string<mega, char> { @@ -608,8 +397,6 @@ struct ratio_string<mega, char> static std::string prefix() {return std::string("mega");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<mega, char16_t> { @@ -624,28 +411,15 @@ struct ratio_string<mega, char32_t> static std::u32string prefix() {return std::u32string(U"mega");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<mega, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'M');} static std::wstring prefix() {return std::wstring(L"mega");} }; -#endif -#endif // giga -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<giga, CharT> : - ratio_detail::ratio_string_static<giga,CharT> -{}; - -#else - template <> struct ratio_string<giga, char> { @@ -653,8 +427,6 @@ struct ratio_string<giga, char> static std::string prefix() {return std::string("giga");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<giga, char16_t> { @@ -669,28 +441,15 @@ struct ratio_string<giga, char32_t> static std::u32string prefix() {return std::u32string(U"giga");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<giga, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'G');} static std::wstring prefix() {return std::wstring(L"giga");} }; -#endif -#endif // tera -//template <> -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<tera, CharT> : - ratio_detail::ratio_string_static<tera,CharT> -{}; - -#else template <> struct ratio_string<tera, char> { @@ -698,8 +457,6 @@ struct ratio_string<tera, char> static std::string prefix() {return std::string("tera");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<tera, char16_t> { @@ -714,27 +471,15 @@ struct ratio_string<tera, char32_t> static std::u32string prefix() {return std::u32string(U"tera");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<tera, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'T');} static std::wstring prefix() {return std::wstring(L"tera");} }; -#endif -#endif // peta -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<peta, CharT> : - ratio_detail::ratio_string_static<peta,CharT> -{}; - -#else template <> struct ratio_string<peta, char> { @@ -742,8 +487,6 @@ struct ratio_string<peta, char> static std::string prefix() {return std::string("peta");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<peta, char16_t> { @@ -758,27 +501,15 @@ struct ratio_string<peta, char32_t> static std::u32string prefix() {return std::u32string(U"peta");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<peta, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'P');} static std::wstring prefix() {return std::wstring(L"peta");} }; -#endif -#endif // exa -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<exa, CharT> : - ratio_detail::ratio_string_static<exa,CharT> -{}; - -#else template <> struct ratio_string<exa, char> { @@ -786,8 +517,6 @@ struct ratio_string<exa, char> static std::string prefix() {return std::string("exa");} }; -#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT - template <> struct ratio_string<exa, char16_t> { @@ -802,275 +531,13 @@ struct ratio_string<exa, char32_t> static std::u32string prefix() {return std::u32string(U"exa");} }; -#endif - -#ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string<exa, wchar_t> { static std::wstring symbol() {return std::wstring(1, L'E');} static std::wstring prefix() {return std::wstring(L"exa");} }; -#endif -#endif - - -#ifdef BOOST_RATIO_EXTENSIONS - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<kibi, CharT> : - ratio_detail::ratio_string_static<kibi,CharT> -{}; - -#else -template <> -struct ratio_string<kibi, char> -{ - static std::string symbol() {return std::string("Ki");} - static std::string prefix() {return std::string("kibi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<kibi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Ki");} - static std::u16string prefix() {return std::u16string(u"kibi");} -}; - -template <> -struct ratio_string<kibi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Ki");} - static std::u32string prefix() {return std::u32string(U"kibi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<kibi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Ki");} - static std::wstring prefix() {return std::wstring(L"kibi");} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<mebi, CharT> : - ratio_detail::ratio_string_static<mebi,CharT> -{}; - -#else -template <> -struct ratio_string<mebi, char> -{ - static std::string symbol() {return std::string("Mi");} - static std::string prefix() {return std::string("mebi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<mebi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Mi");} - static std::u16string prefix() {return std::u16string(u"mebi");} -}; - -template <> -struct ratio_string<mebi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Mi");} - static std::u32string prefix() {return std::u32string(U"mebi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<mebi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Mi");} - static std::wstring prefix() {return std::wstring(L"mebi");} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<gibi, CharT> : - ratio_detail::ratio_string_static<gibi,CharT> -{}; - -#else -template <> -struct ratio_string<gibi, char> -{ - static std::string symbol() {return std::string("Gi");} - static std::string prefix() {return std::string("gibi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<gibi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Gi");} - static std::u16string prefix() {return std::u16string(u"gibi");} -}; - -template <> -struct ratio_string<gibi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Gi");} - static std::u32string prefix() {return std::u32string(U"gibi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<gibi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Gi");} - static std::wstring prefix() {return std::wstring(L"gibi");} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<tebi, CharT> : - ratio_detail::ratio_string_static<tebi,CharT> -{}; - -#else -template <> -struct ratio_string<tebi, char> -{ - static std::string symbol() {return std::string("Ti");} - static std::string prefix() {return std::string("tebi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<tebi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Ti");} - static std::u16string prefix() {return std::u16string(u"tebi");} -}; - -template <> -struct ratio_string<tebi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Ti");} - static std::u32string prefix() {return std::u32string(U"tebi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<tebi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Ti");} - static std::wstring prefix() {return std::wstring(L"tebi");} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<pebi, CharT> : - ratio_detail::ratio_string_static<pebi,CharT> -{}; - -#else -template <> -struct ratio_string<pebi, char> -{ - static std::string symbol() {return std::string("Pi");} - static std::string prefix() {return std::string("pebi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<pebi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Pi");} - static std::u16string prefix() {return std::u16string(u"pebi");} -}; - -template <> -struct ratio_string<pebi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Pi");} - static std::u32string prefix() {return std::u32string(U"pebi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<pebi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Pi");} - static std::wstring prefix() {return std::wstring(L"pebi");} -}; -#endif -#endif - -#ifdef BOOST_RATIO_HAS_STATIC_STRING -template <typename CharT> -struct ratio_string<exbi, CharT> : - ratio_detail::ratio_string_static<exbi,CharT> -{}; - -#else -template <> -struct ratio_string<exbi, char> -{ - static std::string symbol() {return std::string("Ei");} - static std::string prefix() {return std::string("exbi");} -}; - -#if BOOST_RATIO_HAS_UNICODE_SUPPORT - -template <> -struct ratio_string<exbi, char16_t> -{ - static std::u16string symbol() {return std::u16string(u"Ei");} - static std::u16string prefix() {return std::u16string(u"exbi");} -}; - -template <> -struct ratio_string<exbi, char32_t> -{ - static std::u32string symbol() {return std::u32string(U"Ei");} - static std::u32string prefix() {return std::u32string(U"exbi");} -}; - -#endif - -#ifndef BOOST_NO_STD_WSTRING -template <> -struct ratio_string<exbi, wchar_t> -{ - static std::wstring symbol() {return std::wstring(L"Ei");} - static std::wstring prefix() {return std::wstring(L"exbi");} -}; -#endif -#endif -#endif } -#endif // BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 #endif // BOOST_RATIO_RATIO_IO_HPP diff --git a/contrib/restricted/boost/ratio/ya.make b/contrib/restricted/boost/ratio/ya.make index 4f65a6b1de..9305024407 100644 --- a/contrib/restricted/boost/ratio/ya.make +++ b/contrib/restricted/boost/ratio/ya.make @@ -6,19 +6,9 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.83.0) - -ORIGINAL_SOURCE(https://github.com/boostorg/ratio/archive/boost-1.83.0.tar.gz) - -PEERDIR( - contrib/restricted/boost/config - contrib/restricted/boost/core - contrib/restricted/boost/integer - contrib/restricted/boost/mpl - contrib/restricted/boost/rational - contrib/restricted/boost/static_assert - contrib/restricted/boost/type_traits -) +VERSION(1.84.0) + +ORIGINAL_SOURCE(https://github.com/boostorg/ratio/archive/boost-1.84.0.tar.gz) ADDINCL( GLOBAL contrib/restricted/boost/ratio/include diff --git a/contrib/restricted/boost/rational/CMakeLists.darwin-arm64.txt b/contrib/restricted/boost/rational/CMakeLists.darwin-arm64.txt deleted file mode 100644 index c4d92a21a6..0000000000 --- a/contrib/restricted/boost/rational/CMakeLists.darwin-arm64.txt +++ /dev/null @@ -1,24 +0,0 @@ - -# This file was generated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(restricted-boost-rational INTERFACE) -target_include_directories(restricted-boost-rational INTERFACE - ${CMAKE_SOURCE_DIR}/contrib/restricted/boost/rational/include -) -target_link_libraries(restricted-boost-rational INTERFACE - contrib-libs-cxxsupp - restricted-boost-assert - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-static_assert - restricted-boost-throw_exception - restricted-boost-type_traits - restricted-boost-utility -) diff --git a/contrib/restricted/boost/rational/CMakeLists.linux-aarch64.txt b/contrib/restricted/boost/rational/CMakeLists.linux-aarch64.txt deleted file mode 100644 index 61fd5149ab..0000000000 --- a/contrib/restricted/boost/rational/CMakeLists.linux-aarch64.txt +++ /dev/null @@ -1,25 +0,0 @@ - -# This file was generated by the build system used internally in the Yandex monorepo. -# Only simple modifications are allowed (adding source-files to targets, adding simple properties -# like target_include_directories). These modifications will be ported to original -# ya.make files by maintainers. Any complex modifications which can't be ported back to the -# original buildsystem will not be accepted. - - - -add_library(restricted-boost-rational INTERFACE) -target_include_directories(restricted-boost-rational INTERFACE - ${CMAKE_SOURCE_DIR}/contrib/restricted/boost/rational/include -) -target_link_libraries(restricted-boost-rational INTERFACE - contrib-libs-linux-headers - contrib-libs-cxxsupp - restricted-boost-assert - restricted-boost-config - restricted-boost-core - restricted-boost-integer - restricted-boost-static_assert - restricted-boost-throw_exception - restricted-boost-type_traits - restricted-boost-utility -) diff --git a/contrib/restricted/boost/rational/CMakeLists.txt b/contrib/restricted/boost/rational/CMakeLists.txt index d863ebd180..7803a2712c 100644 --- a/contrib/restricted/boost/rational/CMakeLists.txt +++ b/contrib/restricted/boost/rational/CMakeLists.txt @@ -8,12 +8,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) include(CMakeLists.linux-x86_64.txt) -elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) - include(CMakeLists.linux-aarch64.txt) elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") include(CMakeLists.darwin-x86_64.txt) -elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") - include(CMakeLists.darwin-arm64.txt) elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) include(CMakeLists.windows-x86_64.txt) endif() |