mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 14:22:08 +02:00
Added new concept check,
removed assertion in degug allocator that was being triggered by std lib code ! [SVN r18873]
This commit is contained in:
@ -75,7 +75,11 @@ test-suite regex
|
|||||||
pathology/recursion_test.cpp
|
pathology/recursion_test.cpp
|
||||||
<lib>../../test/build/boost_test_exec_monitor
|
<lib>../../test/build/boost_test_exec_monitor
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[ compile pathology/concept_check.cpp
|
||||||
|
]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
38
test/pathology/concept_check.cpp
Normal file
38
test/pathology/concept_check.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
#include <boost/regex.hpp>
|
||||||
|
#include <boost/concept_archetype.hpp>
|
||||||
|
#include <boost/concept_check.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
typedef boost::bidirectional_iterator_archetype<char> iterator_type;
|
||||||
|
boost::regex r;
|
||||||
|
iterator_type a, b;
|
||||||
|
boost::detail::dummy_constructor dummy;
|
||||||
|
boost::output_iterator_archetype<char> out(dummy);
|
||||||
|
std::string s;
|
||||||
|
boost::match_results<iterator_type> 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<iterator_type>
|
||||||
|
>
|
||||||
|
>();
|
||||||
|
boost::function_requires<
|
||||||
|
boost::ForwardIteratorConcept<
|
||||||
|
boost::regex_token_iterator<iterator_type>
|
||||||
|
>
|
||||||
|
>();
|
||||||
|
|
||||||
|
}
|
@ -157,8 +157,7 @@ public:
|
|||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
void deallocate(pointer p, size_type n)
|
||||||
{
|
{
|
||||||
assert( (p == 0) == (n == 0) );
|
if ((p != 0) && (n != 0))
|
||||||
if (p != 0)
|
|
||||||
base_type::deallocate((void*)p, n * sizeof(value_type));
|
base_type::deallocate((void*)p, n * sizeof(value_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user