diff --git a/include/boost/concept_check.hpp b/include/boost/concept_check.hpp index c1d8dc3..f642448 100644 --- a/include/boost/concept_check.hpp +++ b/include/boost/concept_check.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #if (__GNUC__) || defined(__KCC) || defined(__ghs) || defined(__MWERKS__) #define BOOST_FPTR & @@ -95,9 +96,10 @@ struct require_same { typedef T type; }; struct IntegerConcept { void constraints() { #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - errortype_must_be_an_integer_type(); + x.error_type_not_an_integer(); #endif } + T x; }; #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template <> struct IntegerConcept { void constraints() {} }; @@ -346,6 +348,7 @@ struct require_same { typedef T type; }; f(arg); // require operator() } Func f; + Arg arg; }; #endif @@ -590,13 +593,16 @@ struct require_same { typedef T type; }; void constraints() { function_requires< InputIteratorConcept >(); function_requires< AssignableConcept >(); - const Container c; + const_constraints(c); + } + void const_constraints(const Container& c) { i = c.begin(); i = c.end(); n = c.size(); n = c.max_size(); b = c.empty(); } + Container c; bool b; const_iterator i; size_type n; @@ -654,12 +660,15 @@ struct require_same { typedef T type; }; void constraints() { function_requires< ForwardContainerConcept >(); function_requires< BidirectionalIteratorConcept >(); - function_requires< BidirectionalIteratorConcept >(); - - const ReversibleContainer c; + function_requires< + BidirectionalIteratorConcept >(); + const_constraints(c); + } + void const_constraints(const ReversibleContainer& c) { const_reverse_iterator i = c.rbegin(); i = c.rend(); } + ReversibleContainer c; }; template @@ -670,9 +679,11 @@ struct require_same { typedef T type; }; void constraints() { function_requires< ReversibleContainerConcept >(); - function_requires< Mutable_ForwardContainerConcept >(); + function_requires< + Mutable_ForwardContainerConcept >(); function_requires< Mutable_BidirectionalIteratorConcept >(); - function_requires< Mutable_BidirectionalIteratorConcept >(); + function_requires< + Mutable_BidirectionalIteratorConcept >(); reverse_iterator i = c.rbegin(); i = c.rend(); @@ -692,12 +703,16 @@ struct require_same { typedef T type; }; void constraints() { function_requires< ReversibleContainerConcept >(); function_requires< RandomAccessIteratorConcept >(); - function_requires< RandomAccessIteratorConcept >(); + function_requires< + RandomAccessIteratorConcept >(); - const RandomAccessContainer c; + const_constraints(c); + } + void const_constraits(const RandomAccessContainer& c) { const_reference r = c[n]; ignore_unused_variable_warning(r); } + RandomAccessContainer c; size_type n; }; @@ -710,10 +725,13 @@ struct require_same { typedef T type; }; typedef typename RandomAccessContainer::reverse_iterator reverse_iterator; void constraints() { - function_requires< RandomAccessContainerConcept >(); - function_requires< Mutable_ReversibleContainerConcept >(); + function_requires< + RandomAccessContainerConcept >(); + function_requires< + Mutable_ReversibleContainerConcept >(); function_requires< Mutable_RandomAccessIteratorConcept >(); - function_requires< Mutable_RandomAccessIteratorConcept >(); + function_requires< + Mutable_RandomAccessIteratorConcept >(); reference r = c[i]; ignore_unused_variable_warning(r);