Debian Codegraph @

libstdc++-v3/testsuite/23_containers/multimap/allocator/ext_ptr.cc

raw
1 // { dg-do run { target c++11 } }
2
3 #include <map>
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::multimap<T, int, L,
19 CustomPointerAlloc<std::pair<const T, int>>>;
20
21 void test01()
22 {
23 typedef CustomPointerAlloc<std::pair<const T, int>> alloc_type;
24 typedef std::multimap<T, int, L, alloc_type> test_type;
25 test_type v;
26 v.insert({ T(), 0 });
27 VERIFY( ++v.begin() == v.end() );
28 }
29
30 int main()
31 {
32 test01();
33 }