diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/phoenix/test/container/container_tests12b.cpp | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/phoenix/test/container/container_tests12b.cpp')
-rw-r--r-- | src/boost/libs/phoenix/test/container/container_tests12b.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/boost/libs/phoenix/test/container/container_tests12b.cpp b/src/boost/libs/phoenix/test/container/container_tests12b.cpp new file mode 100644 index 00000000..63f167c4 --- /dev/null +++ b/src/boost/libs/phoenix/test/container/container_tests12b.cpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2004 Angus Leeming + Copyright (c) 2017 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include "container_tests.hpp" +#include <boost/static_assert.hpp> + +std::unordered_set<int> const build_unordered_set() +{ + typedef std::unordered_set<int> int_set; + typedef std::vector<int> int_vector; + + int_set result; + int_vector const data = build_vector(); + int_vector::const_iterator it = data.begin(); + int_vector::const_iterator const end = data.end(); + result.insert(it, end); + return result; +} + +std::unordered_multiset<int> const build_unordered_multiset() +{ + typedef std::unordered_set<int> int_set; + typedef std::unordered_multiset<int> int_multiset; + int_set const data = build_unordered_set(); + return int_multiset(data.begin(), data.end()); +} + +std::vector<int> const init_vector() +{ + typedef std::vector<int> int_vector; + int const data[] = { -4, -3, -2, -1, 0 }; + int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]); + return int_vector(data, data + data_size); +} + +std::vector<int> const build_vector() +{ + typedef std::vector<int> int_vector; + static int_vector data = init_vector(); + int_vector::size_type const size = data.size(); + int_vector::iterator it = data.begin(); + int_vector::iterator const end = data.end(); + for (; it != end; ++it) + *it += size; + return data; +} + +int +main() +{ + BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_multiset<int> >::value)); + BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multiset<int> >::value)); + + std::unordered_multiset<int> const data = build_unordered_multiset(); + test_multiset_insert(data); + //test_key_comp(data); + test_max_size(data); + //test_rbegin(data); + //test_rend(data); + test_size(data); + //test_value_comp(data); + return boost::report_errors(); +} + + + + |