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]

[patch] : Fix std::mismatch concept check


This patch fixes the concept check on std::mismatch. Given mismatch(first1, last1, first2), the old concept check made sure that *first1==*first1 and *first2==*first2 are defined. In fact what is required is that *first1=*first2 is required.

This is caught by the previous testcase I submitted once -D_GLIBCXX_CONCEPT_CHECKS is passed. I've written this against a clean stl_algobase.h (not against the one I submitted a couple of days ago) as this can be applied to the cvs branch instead of just so_7.

2005-01-02 Chris Jefferson <chris@bubblescope.net>

* include/bits/stl_algobase.h (mismatch): Correct concept check.


Index: stl_algobase.h
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/include/bits/stl_algobase.h,v
retrieving revision 1.30.6.3
diff -u -r1.30.6.3 stl_algobase.h
--- stl_algobase.h	10 Oct 2004 21:08:45 -0000	1.30.6.3
+++ stl_algobase.h	2 Jan 2005 16:07:18 -0000
@@ -679,10 +679,9 @@
       // concept requirements
       __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
       __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
-      __glibcxx_function_requires(_EqualityComparableConcept<
-	    typename iterator_traits<_InputIterator1>::value_type>)
-      __glibcxx_function_requires(_EqualityComparableConcept<
-	    typename iterator_traits<_InputIterator2>::value_type>)
+      __glibcxx_function_requires(_EqualOpConcept<
+            typename iterator_traits<_InputIterator1>::value_type,
+            typename iterator_traits<_InputIterator2>::value_type>)
       __glibcxx_requires_valid_range(__first1, __last1);
 
       while (__first1 != __last1 && *__first1 == *__first2)

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