1 /*============================================================================= 2 Copyright (c) 2004 Angus Leeming 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 ==============================================================================*/ 7 #include "container_tests.hpp" 8 #include <boost/static_assert.hpp> 9 init_vector()10std::vector<int> const init_vector() 11 { 12 typedef std::vector<int> int_vector; 13 int const data[] = { -4, -3, -2, -1, 0 }; 14 int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]); 15 return int_vector(data, data + data_size); 16 } 17 build_vector()18std::vector<int> const build_vector() 19 { 20 typedef std::vector<int> int_vector; 21 static int_vector data = init_vector(); 22 int_vector::size_type const size = data.size(); 23 int_vector::iterator it = data.begin(); 24 int_vector::iterator const end = data.end(); 25 for (; it != end; ++it) 26 *it += size; 27 return data; 28 } 29 30 int main()31main() 32 { 33 BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::vector<int> >::value)); 34 BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::vector<int> >::value)); 35 36 std::vector<int> const data = build_vector(); 37 test_get_allocator(data); 38 test_insert(data); 39 test_max_size(data); 40 test_pop_back(data); 41 test_push_back(data); 42 test_rbegin(data); 43 test_rend(data); 44 test_reserve(data); 45 test_resize(data); 46 test_size(data); 47 return boost::report_errors(); 48 } 49 50