A better practice for template programming
By Jeremy Siek and Andrew Lumsdaine, June 01, 2001
The flexibility provided by C++ templates generally comes at the expense of type safety. Jeremy and Andrew present a technique for reintroducing type safety into template functions.
Jun01: C++ Concept Checking
stl_algo.h: In function 'void
__inplace_stable_sort<_List_iterator<...>
>(_List_iterator<...>, _List_iterator<...>)':
stl_algo.h:1521: instantiated from herestl_algo .h:1342: no match for
'_List_iterator<...> & - _List_iterator<...> &'
</p>
Example 3: Compiler error.