Changeset View
Changeset View
Standalone View
Standalone View
test/std/re/re.results/re.results.const/allocator.pass.cpp
Show All 18 Lines | |||||
#include "test_allocator.h" | #include "test_allocator.h" | ||||
template <class CharT, class Allocator> | template <class CharT, class Allocator> | ||||
void | void | ||||
test(const Allocator& a) | test(const Allocator& a) | ||||
{ | { | ||||
std::match_results<const CharT*, Allocator> m(a); | std::match_results<const CharT*, Allocator> m(a); | ||||
assert(m.size() == 0); | assert(m.size() == 0); | ||||
assert(m.str() == std::basic_string<CharT>()); | assert(!m.ready() || m.str() == std::basic_string<CharT>()); | ||||
assert(m.get_allocator() == a); | assert(m.get_allocator() == a); | ||||
} | } | ||||
int main(int, char**) | int main(int, char**) | ||||
{ | { | ||||
test<char>(test_allocator<std::sub_match<const char*> >(3)); | test<char>(test_allocator<std::sub_match<const char*> >(3)); | ||||
test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3)); | test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3)); | ||||
return 0; | return 0; | ||||
} | } |