Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/iostreams/example/std_back_inserter_example.cpp @ 29

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

updated boost from 1_33_1 to 1_34_1

File size: 635 bytes
Line 
1// (C) Copyright Jonathan Turkanis 2005.
2// Distributed under the Boost Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
4
5// See http://www.boost.org/libs/iostreams for documentation.
6
7#include <cassert>
8#include <iterator>  // back_inserter
9#include <string>
10#include <boost/iostreams/filtering_stream.hpp>
11
12namespace io = boost::iostreams;
13
14int main()
15{
16    using namespace std;
17
18    string                 result;
19    io::filtering_ostream  out(std::back_inserter(result));
20    out << "Hello World!";
21    out.flush();
22    assert(result == "Hello World!");
23}
Note: See TracBrowser for help on using the repository browser.