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.
    -
  1. The location of the error, line 9 of bad_error_eg.cpp +
  2. The location of the error, line 6 of bad_error_eg.cpp is not pointed to by the error message, despite the fact that Gnu C++ prints up to 4 levels deep in the instantiation stack.
  3. There is no textual correlation between the error message and the @@ -241,21 +238,21 @@ Library produces):
     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.