PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/phoenix/test/container/container_tests4a.cpp

http://hadesmem.googlecode.com/
C++ | 47 lines | 37 code | 4 blank | 6 comment | 2 complexity | ac55aeeb97c2b13b53f2117f876bcb8c MD5 | raw file
 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
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
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
30int
31main()
32{
33    std::vector<int> const data = build_vector();
34    test_assign(data);
35    test_assign2(data);
36    test_at(data);
37    test_back(data);
38    test_begin(data);
39    test_capacity(data);
40    test_clear(data);
41    test_end(data);
42    test_empty(data);
43    test_erase(data);
44    test_front(data);
45    return boost::report_errors();
46}
47