diff --git a/concept_check.htm b/concept_check.htm index f68626a..911153b 100644 --- a/concept_check.htm +++ b/concept_check.htm @@ -169,14 +169,11 @@ a linked list. 1 #include <list> 2 #include <algorithm> 3 - 4 struct foo { - 5 bool operator<(const foo&) const { return false; } - 6 }; - 7 int main(int, char*[]) { - 8 std::list<foo> v; - 9 std::stable_sort(v.begin(), v.end()); - 10 return 0; - 11 } + 4 int main(int, char*[]) { + 5 std::list<int> v; + 6 std::stable_sort(v.begin(), v.end()); + 7 return 0; + 8 } Here, the @@ -192,18 +189,18 @@ Appendix.
stl_algo.h: In function `void __merge_sort_loop<_List_iterator - <foo,foo &,foo *>, foo *, int>(_List_iterator<foo,foo &,foo *>, - _List_iterator<foo,foo &,foo *>, foo *, int)': + <int,int &,int *>, int *, int>(_List_iterator<int,int &,int *>, + _List_iterator<int,int &,int *>, int *, int)': stl_algo.h:1448: instantiated from `__merge_sort_with_buffer - <_List_iterator<foo,foo &,foo *>, foo *, int>( - _List_iterator<foo,foo &,foo *>, _List_iterator<foo,foo &,foo *>, - foo *, int *)' + <_List_iterator<int,int &,int *>, int *, int>( + _List_iterator<int,int &,int *>, _List_iterator<int,int &,int *>, + int *, int *)' stl_algo.h:1485: instantiated from `__stable_sort_adaptive< - _List_iterator<foo,foo &,foo *>, foo *, int>(_List_iterator - <foo,foo &,foo *>, _List_iterator<foo,foo &,foo *>, foo *, int)' + _List_iterator<int,int &,int *>, int *, int>(_List_iterator + <int,int &,int *>, _List_iterator<int,int &,int *>, int *, int)' stl_algo.h:1524: instantiated from here -stl_algo.h:1377: no match for `_List_iterator<foo,foo &,foo *> & - - _List_iterator<foo,foo &,foo *> &' +stl_algo.h:1377: no match for `_List_iterator<int,int &,int *> & - + _List_iterator<int,int &,int *> &'In this case, the fundamental error is that @@ -219,7 +216,7 @@ the error may be obvious. However, for the uninitiated, there are several reasons why this message would be hard to understand.
boost/concept_check.hpp: In method `void LessThanComparableConcept - <_List_iterator<foo,foo &,foo *> >::constraints()': + <_List_iterator<int,int &,int *> >::constraints()': boost/concept_check.hpp:334: instantiated from `RandomAccessIteratorConcept - <_List_iterator<foo,foo &,foo *> >::constraints()' -bad_error_eg.cpp:9: instantiated from `stable_sort<_List_iterator - <foo,foo &,foo *> >(_List_iterator<foo,foo &,foo *>, - _List_iterator<foo,foo &,foo *>)' -boost/concept_check.hpp:209: no match for `_List_iterator<foo,foo &,foo *> & - < _List_iterator<foo,foo &,foo *> &' + <_List_iterator<int,int &,int *> >::constraints()' +bad_error_eg.cpp:6: instantiated from `stable_sort<_List_iterator + <int,int &,int *> >(_List_iterator<int,int &,int *>, + _List_iterator<int,int &,int *>)' +boost/concept_check.hpp:209: no match for `_List_iterator<int,int &,int *> & + < _List_iterator<int,int &,int *> &'This message rectifies several of the shortcomings of the standard error messages.