]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/lambda/test/istreambuf_test.cpp
1 // istreambuf_test - test lambda function objects with istreambuf_iterator
3 // Copyright (c) 2007 Peter Dimov
5 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
9 #include <boost/lambda/lambda.hpp>
10 #include <boost/detail/lightweight_test.hpp>
17 using namespace boost::lambda
;
19 std::stringstream
is( "ax2" );
21 std::istreambuf_iterator
<char> b2( is
);
22 std::istreambuf_iterator
<char> e2
;
24 std::istreambuf_iterator
<char> i
= std::find_if( b2
, e2
, _1
== 'x' );
26 BOOST_TEST( *i
== 'x' );
27 BOOST_TEST( std::distance( i
, e2
) == 2 );
29 return boost::report_errors();