Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/iostreams/example/container_sink_example.cpp @ 14

Last change on this file since 14 was 12, checked in by landauf, 17 years ago

added boost

  • Property svn:executable set to *
File size: 741 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 <string>
9#include <boost/iostreams/stream_facade.hpp>
10#include <libs/iostreams/example/container_device.hpp>
11
12namespace io = boost::iostreams;
13namespace ex = boost::iostreams::example;
14
15int main()
16{
17    using namespace std;
18    typedef ex::container_sink<string> string_sink;
19
20    string                          result;
21    io::stream_facade<string_sink>  out(result);
22    out << "Hello World!";
23    out.flush();
24    assert(result == "Hello World!");
25}
Note: See TracBrowser for help on using the repository browser.