| 1 | // { dg-do run { target c++11 } } |
| 2 | |
| 3 | #include <set> |
| 4 | #include <memory> |
| 5 | #include <testsuite_hooks.h> |
| 6 | #include <testsuite_allocator.h> |
| 7 | |
| 8 | struct T { int i; }; |
| 9 | |
| 10 | bool operator<(const T& l, const T& r) |
| 11 | { return l.i < r.i; } |
| 12 | |
| 13 | struct L : std::less<T> |
| 14 | { }; |
| 15 | |
| 16 | using __gnu_test::CustomPointerAlloc; |
| 17 | |
| 18 | template class std::set<T, L, CustomPointerAlloc<T>>; |
| 19 | |
| 20 | void test01() |
| 21 | { |
| 22 | typedef CustomPointerAlloc<T> alloc_type; |
| 23 | typedef std::set<T, L, alloc_type> test_type; |
| 24 | test_type v; |
| 25 | v.insert(T()); |
| 26 | VERIFY( ++v.begin() == v.end() ); |
| 27 | } |
| 28 | |
| 29 | int main() |
| 30 | { |
| 31 | test01(); |
| 32 | } |