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_assign(data); 38 test_assign2(data); 39 test_at(data); 40 test_back(data); 41 test_begin(data); 42 test_capacity(data); 43 test_clear(data); 44 test_end(data); 45 test_empty(data); 46 test_erase(data); 47 test_front(data); 48 return boost::report_errors(); 49 } 50 51