1// misc.cpp
2//
3// (C) Copyright Eric Niebler 2008.
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)
7
8/*
9 Revision history:
10 4 March 2008 : Initial version.
11*/
12
13#include <vector>
14#include <boost/core/lightweight_test.hpp>
15#include <boost/foreach.hpp>
16
17struct xxx : std::vector<int>
18{
19 virtual ~xxx() = 0;
20};
21
22void test_abstract(xxx& rng)
23{
24 BOOST_FOREACH (int x, rng)
25 {
26 (void)x;
27 }
28}
29
30struct yyy : std::vector<int>
31{
32 void test()
33 {
34 BOOST_FOREACH(int x, *this)
35 {
36 (void)x;
37 }
38 }
39};
40
41///////////////////////////////////////////////////////////////////////////////
42// test_main
43//
44int main()
45{
46 return boost::report_errors();
47}
48

source code of boost/libs/foreach/test/misc.cpp