/////////////////////////////////////////////////////////////////////////////// // Copyright 2021 John Maddock. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_IS_CONVERTIBLE_ARITHMETIC_HPP #define BOOST_IS_CONVERTIBLE_ARITHMETIC_HPP #include #include #include namespace boost { namespace multiprecision { namespace detail { template struct is_convertible_arithmetic { static constexpr bool value = boost::multiprecision::detail::is_arithmetic::value; }; // // For extension types, we don't *require* interoperability, // so only enable it if we can convert the type to the backend // losslessly, ie not via conversion to a narrower type. // Note that backends with templated constructors/=operators // will not be selected here, so these need to either specialize // this trait, or provide a proper non-template constructor/=operator // for the extension types it supports. // #ifdef BOOST_HAS_FLOAT128 template struct is_convertible_arithmetic { static constexpr bool value = std::is_assignable>::value; }; #endif #ifdef BOOST_HAS_INT128 template struct is_convertible_arithmetic { static constexpr bool value = std::is_assignable>::value; }; template struct is_convertible_arithmetic { static constexpr bool value = std::is_assignable>::value; }; #endif }}} // namespace boost::multiprecision::detail #endif // BOOST_IS_BYTE_CONTAINER_HPP