Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / container / test / pair_test.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2011-2013. 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 #include <boost/container/detail/config_begin.hpp>
11 #include <boost/container/detail/pair.hpp>
12 #include "movable_int.hpp"
13 #include "emplace_test.hpp"
14 #include<boost/move/utility_core.hpp>
15
16 //non_copymovable_int
17 //copyable_int
18 //movable_int
19 //movable_and_copyable_int
20
21
22 using namespace ::boost::container;
23
24 int main ()
25 {
26    {
27       container_detail::pair<test::non_copymovable_int, test::non_copymovable_int> p1;
28       container_detail::pair<test::copyable_int, test::copyable_int> p2;
29       container_detail::pair<test::movable_int, test::movable_int> p3;
30       container_detail::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> p4;
31    }
32    {  //Constructible from two values
33       container_detail::pair<test::non_copymovable_int, test::non_copymovable_int> p1(1, 2);
34       container_detail::pair<test::copyable_int, test::copyable_int> p2(1, 2);
35       container_detail::pair<test::movable_int, test::movable_int> p3(1, 2);
36       container_detail::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> p4(1, 2);
37    }
38
39    {  //Constructible from internal types
40       container_detail::pair<test::copyable_int, test::copyable_int> p2(test::copyable_int(1), test::copyable_int(2));
41       {
42          test::movable_int a(1), b(2);
43          container_detail::pair<test::movable_int, test::movable_int> p3(::boost::move(a), ::boost::move(b));
44       }
45       {
46          test::movable_and_copyable_int a(1), b(2);
47          container_detail::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> p4(::boost::move(a), ::boost::move(b));
48       }
49    }
50    //piecewise_construct missing...
51    return 0;
52 }
53
54 #include <boost/container/detail/config_end.hpp>