Nathan Ridge wrote:
#include "boost/concept/requires.hpp" #include "boost/concept_check.hpp" #include <iterator> template <typename T> BOOST_CONCEPT_REQUIRES(( ((boost::ForwardIterator<T>)) ((boost::LessThanComparable< typename std::iterator_traits<T>::value_type
)) ), (void) ) bubble_sort(T begin, T end);
if I compile this with gcc 4.5.3 I get some error messages which I don't expect to see:
You have an extra pair of parentheses grouping the requirements that shouldn't be there. It should be just:
BOOST_CONCEPT_REQUIRES( // note: removed one '(' ((boost::ForwardIterator<T>)) ((boost::LessThanComparable< typename std::iterator_traits<T>::value_type
)) , // note: removed ')' (void) ) bubble_sort(T begin, T end);
See the example usage in the documentation [1].
Regards, Nate
[1] http://www.boost.org/doc/libs/1_54_0/libs/concept_check/using_concept_check.... =
Damn! - I must of checked that 20 times! Thanks for spotting this for me. Robert Ramey