diff --git a/test/Jamfile b/test/Jamfile index fd10197b..de2945ed 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -75,7 +75,11 @@ test-suite regex pathology/recursion_test.cpp ../../test/build/boost_test_exec_monitor ] + + [ compile pathology/concept_check.cpp + ] ; + diff --git a/test/pathology/concept_check.cpp b/test/pathology/concept_check.cpp new file mode 100644 index 00000000..65edb04f --- /dev/null +++ b/test/pathology/concept_check.cpp @@ -0,0 +1,38 @@ + +#include +#include +#include + + +int main() +{ + typedef boost::bidirectional_iterator_archetype iterator_type; + boost::regex r; + iterator_type a, b; + boost::detail::dummy_constructor dummy; + boost::output_iterator_archetype out(dummy); + std::string s; + boost::match_results what; + + boost::regex_match(a, b, r); + boost::regex_match(a, b, what, r); + boost::regex_search(a, b, r); + boost::regex_search(a, b, what, r); + out = boost::regex_replace(out, a, b, r, s, boost::match_default); + s = boost::regex_replace(s, r, s, boost::match_default); + + out = what.format(out, s, boost::format_default); + s = what.format(s, boost::format_default); + + boost::function_requires< + boost::ForwardIteratorConcept< + boost::regex_iterator + > + >(); + boost::function_requires< + boost::ForwardIteratorConcept< + boost::regex_token_iterator + > + >(); + +} diff --git a/test/regress/regress.h b/test/regress/regress.h index 94be2e89..a52b90ae 100644 --- a/test/regress/regress.h +++ b/test/regress/regress.h @@ -157,8 +157,7 @@ public: void deallocate(pointer p, size_type n) { - assert( (p == 0) == (n == 0) ); - if (p != 0) + if ((p != 0) && (n != 0)) base_type::deallocate((void*)p, n * sizeof(value_type)); }