[Bug libstdc++/101587] ranges::uninitialized_copy/move incorrectly uses std::min

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 23 09:04:30 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101587

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Maybe we should add this somewhere and just stop using std::min for integers:

  struct __min_fn
  {
    template<typename _Tp, typename _Up>
      typename common_type<_Tp, _Up>::type
      operator()(_Tp __t, _Up __u) const noexcept
      { return std::min<typename common_type<_Tp, _Up>::type>(__t, __u); }
  };
  _GLIBCXX17_INLINE constexpr __min_fn __min{};


More information about the Gcc-bugs mailing list