Skip to content

Commit

Permalink
Use auto with concept / trailing return
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Jan 24, 2025
1 parent e839344 commit 942a009
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/boost/decimal/gcc_decimal32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +79,42 @@ BOOST_DECIMAL_EXPORT class gcc_decimal32 final

// 3.2.8 Binary arithmetic operators.
template <typename Integral>
friend return_type operator+(gcc_decimal32 lhs, Integral rhs)
friend auto operator+(gcc_decimal32 lhs, Integral rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs.underlying() + rhs; }

template <typename Integral>
friend return_type operator+(Integral lhs, gcc_decimal32 rhs)
friend auto operator+(Integral lhs, gcc_decimal32 rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs + rhs.underlying(); }

template <typename Integral>
friend return_type operator-(gcc_decimal32 lhs, Integral rhs)
friend auto operator-(gcc_decimal32 lhs, Integral rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs.underlying() - rhs; }

template <typename Integral>
friend return_type operator-(Integral lhs, gcc_decimal32 rhs)
friend auto operator-(Integral lhs, gcc_decimal32 rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs - rhs.underlying(); }

template <typename Integral>
friend return_type operator*(gcc_decimal32 lhs, Integral rhs)
friend auto operator*(gcc_decimal32 lhs, Integral rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs.underlying() * rhs; }

template <typename Integral>
friend return_type operator*(Integral lhs, gcc_decimal32 rhs)
friend auto operator*(Integral lhs, gcc_decimal32 rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs * rhs.underlying(); }

template <typename Integral>
friend return_type operator/(gcc_decimal32 lhs, Integral rhs)
friend auto operator/(gcc_decimal32 lhs, Integral rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs.underlying() / rhs; }

template <typename Integral>
friend return_type operator/(Integral lhs, gcc_decimal32 rhs)
friend auto operator/(Integral lhs, gcc_decimal32 rhs)
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integral, return_type)
{ return lhs / rhs.underlying(); }
};
Expand Down

0 comments on commit 942a009

Please sign in to comment.