// Copyright 2023 Matt Borland // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #ifndef BOOST_DECIMAL_DETAIL_MIXED_DECIMAL_ARITHMETIC_HPP #define BOOST_DECIMAL_DETAIL_MIXED_DECIMAL_ARITHMETIC_HPP #include #include #include #include #include #ifndef BOOST_DECIMAL_BUILD_MODULE #include #endif namespace boost { namespace decimal { template constexpr auto operator+(Decimal1 lhs, Decimal2 rhs) noexcept -> std::enable_if_t<(detail::is_decimal_floating_point_v && detail::is_decimal_floating_point_v), detail::promote_args_t> { using Promoted_Type = detail::promote_args_t; return static_cast(lhs) + static_cast(rhs); } template constexpr auto operator-(Decimal1 lhs, Decimal2 rhs) noexcept -> std::enable_if_t<(detail::is_decimal_floating_point_v && detail::is_decimal_floating_point_v), detail::promote_args_t> { using Promoted_Type = detail::promote_args_t; return static_cast(lhs) - static_cast(rhs); } template constexpr auto operator*(Decimal1 lhs, Decimal2 rhs) noexcept -> std::enable_if_t<(detail::is_decimal_floating_point_v && detail::is_decimal_floating_point_v), detail::promote_args_t> { using Promoted_Type = detail::promote_args_t; return static_cast(lhs) * static_cast(rhs); } template constexpr auto operator/(Decimal1 lhs, Decimal2 rhs) noexcept -> std::enable_if_t<(detail::is_decimal_floating_point_v && detail::is_decimal_floating_point_v), detail::promote_args_t> { using Promoted_Type = detail::promote_args_t; return static_cast(lhs) / static_cast(rhs); } } //namespace decimal } //namespace boost #endif //BOOST_DECIMAL_DETAIL_MIXED_DECIMAL_ARITHMETIC_HPP