1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // See http://www.boost.org/libs/container for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10
11 #include <boost/container/flat_map.hpp>
12 #include <boost/container/allocator.hpp>
13 #include "movable_int.hpp"
14 #include "dummy_test_allocator.hpp"
15 #include <boost/container/stable_vector.hpp>
16 #include <boost/container/small_vector.hpp>
17 #include <boost/container/deque.hpp>
18 #include <boost/container/static_vector.hpp>
19
20 struct empty
21 {
operator ==(const empty &,const empty &)22 friend bool operator == (const empty &, const empty &){ return true; }
operator <(const empty &,const empty &)23 friend bool operator < (const empty &, const empty &){ return true; }
24 };
25
26 template class ::boost::container::flat_map<empty, empty>;
27 template class ::boost::container::flat_multimap<empty, empty>;
28
29 volatile ::boost::container::flat_map<empty, empty> dummy;
30 volatile ::boost::container::flat_multimap<empty, empty> dummy2;
31
32 namespace boost {
33 namespace container {
34
35 //Explicit instantiation to detect compilation errors
36
37 //flat_map
38 typedef std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> test_pair_t;
39
40 template class flat_map
41 < test::movable_and_copyable_int
42 , test::movable_and_copyable_int
43 , std::less<test::movable_and_copyable_int>
44 , small_vector< test_pair_t, 10, std::allocator< test_pair_t > >
45 >;
46
47 //flat_multimap
48 template class flat_multimap
49 < test::movable_and_copyable_int
50 , test::movable_and_copyable_int
51 , std::less<test::movable_and_copyable_int>
52 , stable_vector< test_pair_t, allocator< test_pair_t > >
53 >;
54
55 template class flat_multimap
56 < test::movable_and_copyable_int
57 , test::movable_and_copyable_int
58 , std::less<test::movable_and_copyable_int>
59 , deque<test_pair_t, test::simple_allocator< test_pair_t > >
60 >;
61
62 template class flat_multimap
63 < test::movable_and_copyable_int
64 , test::movable_and_copyable_int
65 , std::less<test::movable_and_copyable_int>
66 , static_vector<test_pair_t, 10 >
67 >;
68
69 //As flat container iterators are typedefs for vector::[const_]iterator,
70 //no need to explicit instantiate them
71
72 }} //boost::container
73
74 #if (__cplusplus > 201103L)
75 #include <vector>
76
77 namespace boost{
78 namespace container{
79
80 template class flat_map
81 < test::movable_and_copyable_int
82 , test::movable_and_copyable_int
83 , std::less<test::movable_and_copyable_int>
84 , std::vector<test_pair_t>
85 >;
86
87 }} //boost::container
88
89 #endif
90
main()91 int main()
92 {
93 return 0;
94 }
95