From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- .../phoenix/test/container/container_tests5b.cpp | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/boost/libs/phoenix/test/container/container_tests5b.cpp (limited to 'src/boost/libs/phoenix/test/container/container_tests5b.cpp') diff --git a/src/boost/libs/phoenix/test/container/container_tests5b.cpp b/src/boost/libs/phoenix/test/container/container_tests5b.cpp new file mode 100644 index 00000000..d08a7016 --- /dev/null +++ b/src/boost/libs/phoenix/test/container/container_tests5b.cpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2004 Angus Leeming + + 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" + +std::deque const build_deque() +{ + std::vector const data = build_vector(); + return std::deque(data.begin(), data.end()); +} + +std::vector const init_vector() +{ + typedef std::vector 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 const build_vector() +{ + typedef std::vector 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 >::value)); + BOOST_STATIC_ASSERT((!phx::stl::has_key_type >::value)); + + std::deque const data = build_deque(); + test_insert(data); + test_max_size(data); + test_pop_back(data); + test_pop_front(data); + test_push_back(data); + test_push_front(data); + test_rbegin(data); + test_rend(data); + test_resize(data); + test_size(data); + return boost::report_errors(); +} + + -- cgit v1.2.3