Skip to content

Commit b774aa0

Browse files
committed
Remove constexpr_min duplication.
1 parent fbaf2de commit b774aa0

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

include/boost/integer/common_factor_rt.hpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,28 @@ namespace boost {
5151
//
5252
// some helper functions which really should be constexpr already, but sadly aren't:
5353
//
54-
#ifndef BOOST_NO_CXX14_CONSTEXPR
5554
template <class T>
56-
inline constexpr T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
55+
inline BOOST_CONSTEXPR T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
5756
{
5857
return a < b ? a : b;
5958
}
59+
60+
#ifndef BOOST_NO_CXX14_CONSTEXPR
6061
template <class T>
61-
inline constexpr auto constexpr_swap(T&a, T& b) BOOST_GCD_NOEXCEPT(T) -> decltype(a.swap(b))
62+
inline constexpr auto constexpr_swap(T& a, T& b) BOOST_GCD_NOEXCEPT(T) -> decltype(a.swap(b))
6263
{
6364
return a.swap(b);
6465
}
6566
template <class T, class U>
66-
inline constexpr void constexpr_swap(T&a, U& b...) BOOST_GCD_NOEXCEPT(T)
67+
inline constexpr void constexpr_swap(T& a, U& b...) BOOST_GCD_NOEXCEPT(T)
6768
{
6869
T t(static_cast<T&&>(a));
6970
a = static_cast<T&&>(b);
7071
b = static_cast<T&&>(t);
7172
}
7273
#else
7374
template <class T>
74-
inline T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
75-
{
76-
return a < b ? a : b;
77-
}
78-
template <class T>
79-
inline void constexpr_swap(T&a, T& b) BOOST_GCD_NOEXCEPT(T)
75+
inline void constexpr_swap(T& a, T& b) BOOST_GCD_NOEXCEPT(T)
8076
{
8177
using std::swap;
8278
swap(a, b);

0 commit comments

Comments
 (0)