]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/foreach/test/rvalue_const.cpp
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)
8 25 August 2005 : Initial version.
12 #include <boost/test/minimal.hpp>
13 #include <boost/foreach.hpp>
15 #ifdef BOOST_FOREACH_NO_CONST_RVALUE_DETECTION
16 // ignore error during Microsoft Code Analysis
17 #if !defined(_PREFAST_)
18 # error Expected failure : const rvalues disallowed
22 std::vector
<int> const get_vector()
24 return std::vector
<int>(4, 4);
27 ///////////////////////////////////////////////////////////////////////////////
30 int test_main( int, char*[] )
34 BOOST_FOREACH(int i
, get_vector())
39 BOOST_CHECK(16 == counter
);