]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // (C) Copyright Eric Niebler 2004. |
2 | // Use, modification and distribution are subject to the | |
3 | // Boost Software License, Version 1.0. (See accompanying file | |
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | ||
6 | /* | |
7 | Revision history: | |
8 | 25 August 2005 : Initial version. | |
9 | */ | |
10 | ||
1e59de90 | 11 | #include <boost/core/lightweight_test.hpp> |
7c673cae FG |
12 | #include <boost/foreach.hpp> |
13 | ||
14 | /////////////////////////////////////////////////////////////////////////////// | |
15 | // define the container types, used by utility.hpp to generate the helper functions | |
16 | typedef char *foreach_container_type; | |
17 | typedef char const *foreach_const_container_type; | |
18 | typedef char foreach_value_type; | |
19 | typedef char &foreach_reference_type; | |
20 | typedef char const &foreach_const_reference_type; | |
21 | ||
22 | #include "./utility.hpp" | |
23 | ||
24 | /////////////////////////////////////////////////////////////////////////////// | |
25 | // define some containers | |
26 | // | |
27 | char my_ntcs_buffer[] = "\1\2\3\4\5"; | |
28 | char *my_ntcs = my_ntcs_buffer; | |
29 | char const *my_const_ntcs = my_ntcs; | |
30 | ||
31 | /////////////////////////////////////////////////////////////////////////////// | |
32 | // test_main | |
33 | // | |
1e59de90 | 34 | int main() |
7c673cae FG |
35 | { |
36 | boost::mpl::true_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_ntcs); | |
37 | (void)p; | |
38 | ||
39 | // non-const containers by value | |
1e59de90 | 40 | BOOST_TEST(sequence_equal_byval_n(my_ntcs, "\1\2\3\4\5")); |
7c673cae FG |
41 | |
42 | // const containers by value | |
1e59de90 | 43 | BOOST_TEST(sequence_equal_byval_c(my_const_ntcs, "\1\2\3\4\5")); |
7c673cae | 44 | |
1e59de90 | 45 | return boost::report_errors(); |
7c673cae | 46 | } |