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.
14 #include <boost/core/lightweight_test.hpp>
15 #include <boost/foreach.hpp>
17 ///////////////////////////////////////////////////////////////////////////////
18 // define the container types, used by utility.hpp to generate the helper functions
19 typedef std::list
<int> foreach_container_type
;
20 typedef std::list
<int> const foreach_const_container_type
;
21 typedef int foreach_value_type
;
22 typedef int &foreach_reference_type
;
23 typedef int const &foreach_const_reference_type
;
25 #include "./utility.hpp"
27 ///////////////////////////////////////////////////////////////////////////////
28 // initialize a std::list<int>
29 std::list
<int> make_list()
40 ///////////////////////////////////////////////////////////////////////////////
41 // define some containers
43 std::list
<int> my_list
= make_list();
44 std::list
<int> const &my_const_list
= my_list
;
46 ///////////////////////////////////////////////////////////////////////////////
51 boost::mpl::false_
*p
= BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_list
);
54 // non-const containers by value
55 BOOST_TEST(sequence_equal_byval_n_r(my_list
, "\5\4\3\2\1"));
57 // const containers by value
58 BOOST_TEST(sequence_equal_byval_c_r(my_const_list
, "\5\4\3\2\1"));
60 return boost::report_errors();