]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/iostreams/example/container_source_example.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / iostreams / example / container_source_example.cpp
1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2005-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
5
6 // See http://www.boost.org/libs/iostreams for documentation.
7
8 #include <cassert>
9 #include <string>
10 #include <boost/iostreams/stream.hpp>
11 #include <libs/iostreams/example/container_device.hpp>
12
13 namespace io = boost::iostreams;
14 namespace ex = boost::iostreams::example;
15
16 int main()
17 {
18 using namespace std;
19 typedef ex::container_source<string> string_source;
20
21 string input = "Hello World!";
22 string output;
23 io::stream<string_source> in(input);
24 getline(in, output);
25 assert(input == output);
26 }