|
Boost Users : |
Subject: [Boost-users] question about BOOST_CONCEPT_REQUIRES
From: Robert Ramey (ramey_at_[hidden])
Date: 2013-08-18 15:56:32
#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:
z:\BoostRelease\libs\serialization\test\test_zmisc.cpp:13:1: error: * cannot
appear in a constant-expression
z:\BoostRelease\libs\serialization\test\test_zmisc.cpp:13:1: error: a call
to a constructor cannot appear in a constant-expression
z:\BoostRelease\libs\serialization\test\test_zmisc.cpp:13:1: error: template
argument 1 is invalid
z:\BoostRelease\libs\serialization\test\test_zmisc.cpp:13:1: error: template
argument 1 is invalid
z:\BoostRelease\libs\serialization\test\test_zmisc.cpp:14:28: error: invalid
type in declaration before ; token
Note this occurs even before the template declaration is invoked.
Any insight would be appreciated.
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