3
// (C) Copyright Eric Niebler 2004.
4
// Use, modification and distribution are subject to the
5
// Boost Software License, Version 1.0. (See accompanying file
6
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10
25 August 2005 : Initial version.
13
#include <mlib/tests/_pc_.h>
14
//#include <boost/test/minimal.hpp>
16
#include <boost/foreach.hpp>
18
///////////////////////////////////////////////////////////////////////////////
19
// define the container types, used by utility.hpp to generate the helper functions
20
typedef std::list<int> foreach_container_type;
21
typedef std::list<int> const foreach_const_container_type;
22
typedef int foreach_value_type;
23
typedef int &foreach_reference_type;
24
typedef int const &foreach_const_reference_type;
26
#include "./utility.hpp"
28
///////////////////////////////////////////////////////////////////////////////
29
// initialize a std::list<int>
30
static std::list<int> make_list()
41
///////////////////////////////////////////////////////////////////////////////
42
// define some containers
44
static std::list<int> my_list = make_list();
45
static std::list<int> const &my_const_list = my_list;
47
///////////////////////////////////////////////////////////////////////////////
50
BOOST_AUTO_TEST_CASE( stl_byval_r )
52
check_lightweight<false>(my_list);
54
// non-const containers by value
55
BOOST_CHECK(sequence_equal_byval_n_r(my_list, "\5\4\3\2\1"));
57
// const containers by value
58
BOOST_CHECK(sequence_equal_byval_c_r(my_const_list, "\5\4\3\2\1"));