This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: First patch to simplify <algorithm>


caj wrote:

+  template<typename _ForwardIterator>
+    _ForwardIterator
+    adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
+    {
+      // concept requirements
+      __glibcxx_function_requires(_EqualityComparableConcept<
+	    typename iterator_traits<_ForwardIterator>::value_type>)
+      return adjacent_find(__first, __last,
+             __default_eq_pred<typename iterator_traits<_ForwardIterator>::
+			   value_type>());
+    }

A minor nit: in my opinion, in such cases we should commonize a

typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;

which would help a lot with the obnoxious wrapping issues...

Paolo.


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