]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/container/container_tests9b.cpp
1 /*=============================================================================
2 Copyright (c) 2004 Angus Leeming
3 Copyright (c) 2017 Kohei Takahashi
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #include "container_tests.hpp"
9 #include <boost/static_assert.hpp>
11 std::unordered_map
<int, int> const build_unordered_map()
13 typedef std::unordered_map
<int, int> int_map
;
14 typedef std::vector
<int> int_vector
;
17 int_vector
const data
= build_vector();
18 int_vector::const_iterator it
= data
.begin();
19 int_vector::const_iterator
const end
= data
.end();
20 for (; it
!= end
; ++it
) {
21 int const value
= *it
;
22 result
[value
] = 100 * value
;
27 std::vector
<int> const init_vector()
29 typedef std::vector
<int> int_vector
;
30 int const data
[] = { -4, -3, -2, -1, 0 };
31 int_vector::size_type
const data_size
= sizeof(data
) / sizeof(data
[0]);
32 return int_vector(data
, data
+ data_size
);
35 std::vector
<int> const build_vector()
37 typedef std::vector
<int> int_vector
;
38 static int_vector data
= init_vector();
39 int_vector::size_type
const size
= data
.size();
40 int_vector::iterator it
= data
.begin();
41 int_vector::iterator
const end
= data
.end();
42 for (; it
!= end
; ++it
)
50 BOOST_STATIC_ASSERT((phx::stl::has_mapped_type
<std::unordered_map
<int, int> >::value
));
51 BOOST_STATIC_ASSERT((phx::stl::has_key_type
<std::unordered_map
<int, int> >::value
));
53 std::unordered_map
<int, int> const data
= build_unordered_map();
54 test_map_insert(data
);
55 //test_key_comp(data);
60 //test_value_comp(data);
61 return boost::report_errors();