Skip to content

Commit

Permalink
Fix -Wpessimizing-move
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Dec 19, 2023
1 parent 2018773 commit 678b9d8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions include/boost/multiprecision/detail/min_max.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ inline typename std::enable_if<boost::multiprecision::detail::is_backend<Backend
number<Backend, et_on> t(b);
if (a < t)
return a;
return std::move(t);
return t;
}
template <class tag, class A1, class A2, class A3, class A4, class Backend>
inline typename std::enable_if<boost::multiprecision::detail::is_backend<Backend>::value, const number<Backend, et_on> >::type(min)(const detail::expression<tag, A1, A2, A3, A4>& a, const number<Backend, et_on>& b)
{
number<Backend, et_on> t(a);
if (t < b)
return std::move(t);
return t;
return b;
}
template <class tag, class A1, class A2, class A3, class A4, class tagb, class A1b, class A2b, class A3b, class A4b>
inline typename detail::expression<tag, A1, A2, A3, A4>::result_type(min)(const detail::expression<tag, A1, A2, A3, A4>& a, const detail::expression<tagb, A1b, A2b, A3b, A4b>& b)
{
typename detail::expression<tag, A1, A2, A3, A4>::result_type t1(a), t2(b);
if (t1 < t2)
return std::move(t1);
return std::move(t2);
return t1;
return t2;
}
template <class tag, class A1, class A2, class A3, class A4>
inline typename detail::expression<tag, A1, A2, A3, A4>::result_type(min)(const detail::expression<tag, A1, A2, A3, A4>& a, const detail::expression<tag, A1, A2, A3, A4>& b)
{
typename detail::expression<tag, A1, A2, A3, A4>::result_type t1(a), t2(b);
if (t1 < t2)
return std::move(t1);
return std::move(t2);
return t1;
return t2;
}

template <class Backend>
Expand All @@ -74,31 +74,31 @@ inline typename std::enable_if<boost::multiprecision::detail::is_backend<Backend
number<Backend, et_on> t(b);
if (a > t)
return a;
return std::move(t);
return t;
}
template <class tag, class A1, class A2, class A3, class A4, class Backend>
inline typename std::enable_if<boost::multiprecision::detail::is_backend<Backend>::value, const number<Backend, et_on> >::type(max)(const detail::expression<tag, A1, A2, A3, A4>& a, const number<Backend, et_on>& b)
{
number<Backend, et_on> t(a);
if (t > b)
return std::move(t);
return t;
return b;
}
template <class tag, class A1, class A2, class A3, class A4, class tagb, class A1b, class A2b, class A3b, class A4b>
inline typename detail::expression<tag, A1, A2, A3, A4>::result_type(max)(const detail::expression<tag, A1, A2, A3, A4>& a, const detail::expression<tagb, A1b, A2b, A3b, A4b>& b)
{
typename detail::expression<tag, A1, A2, A3, A4>::result_type t1(a), t2(b);
if (t1 > t2)
return std::move(t1);
return std::move(t2);
return t1;
return t2;
}
template <class tag, class A1, class A2, class A3, class A4>
inline typename detail::expression<tag, A1, A2, A3, A4>::result_type(max)(const detail::expression<tag, A1, A2, A3, A4>& a, const detail::expression<tag, A1, A2, A3, A4>& b)
{
typename detail::expression<tag, A1, A2, A3, A4>::result_type t1(a), t2(b);
if (t1 > t2)
return std::move(t1);
return std::move(t2);
return t1;
return t2;
}

}} // namespace boost::multiprecision
Expand Down

0 comments on commit 678b9d8

Please sign in to comment.