This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Minor tweak to minmax(initializer_list)
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 21 Sep 2008 11:37:45 +0200
- Subject: [v3] Minor tweak to minmax(initializer_list)
Hi,
tested x86_64-linux, committed to mainline.
Paolo.
//////////////////
2008-09-21 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_algo.h (minmax(initializer_list<>): Use make_pair,
consistently with the other overload for initializer_list.
Index: include/bits/stl_algo.h
===================================================================
*** include/bits/stl_algo.h (revision 140523)
--- include/bits/stl_algo.h (working copy)
*************** _GLIBCXX_BEGIN_NAMESPACE(std)
*** 4121,4127 ****
{
pair<const _Tp*, const _Tp*> __p =
std::minmax_element(__l.begin(), __l.end());
! return std::pair<_Tp, _Tp>(*__p.first, *__p.second);
}
template<typename _Tp, typename _Compare>
--- 4121,4127 ----
{
pair<const _Tp*, const _Tp*> __p =
std::minmax_element(__l.begin(), __l.end());
! return std::make_pair(*__p.first, *__p.second);
}
template<typename _Tp, typename _Compare>