// istreambuf_test - test lambda function objects with istreambuf_iterator // // Copyright (c) 2007 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt #include #include #include #include #include int main() { using namespace boost::lambda; std::stringstream is( "ax2" ); std::istreambuf_iterator b2( is ); std::istreambuf_iterator e2; std::istreambuf_iterator i = std::find_if( b2, e2, _1 == 'x' ); BOOST_TEST( *i == 'x' ); BOOST_TEST( std::distance( i, e2 ) == 2 ); return boost::report_errors(); }