Boost logo

Boost Users :

Subject: Re: [Boost-users] question about BOOST_CONCEPT_REQUIRES
From: Robert Ramey (ramey_at_[hidden])
Date: 2013-08-18 16:36:43


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.htm
> =

Damn! - I must of checked that 20 times! Thanks for spotting this for me.

Robert Ramey


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net