This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]