Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/foreach/test/call_once.cpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 776 bytes
Line 
1//  (C) Copyright Eric Niebler 2005.
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
11#include <vector>
12#include <boost/test/minimal.hpp>
13#include <boost/foreach.hpp>
14
15// counter
16int counter = 0;
17
18std::vector<int> my_vector(4,4);
19
20std::vector<int> const &get_vector()
21{
22    ++counter;
23    return my_vector;
24}
25
26
27///////////////////////////////////////////////////////////////////////////////
28// test_main
29//   
30int test_main( int, char*[] )
31{
32    BOOST_FOREACH(int i, get_vector())
33    {
34        ((void)i); // no-op
35    }
36
37    BOOST_CHECK(1 == counter);
38
39    return 0;
40}
Note: See TracBrowser for help on using the repository browser.