| Line | |
|---|
| 1 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
|---|
| 2 | // demo_pimpl.cpp |
|---|
| 3 | |
|---|
| 4 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
|---|
| 5 | // Use, modification and distribution is subject to the Boost Software |
|---|
| 6 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
|---|
| 7 | // http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 8 | |
|---|
| 9 | // should pass compilation and execution |
|---|
| 10 | |
|---|
| 11 | #include <sstream> |
|---|
| 12 | |
|---|
| 13 | #include <boost/archive/text_iarchive.hpp> |
|---|
| 14 | #include <boost/archive/text_oarchive.hpp> |
|---|
| 15 | |
|---|
| 16 | #include "demo_pimpl_A.hpp" |
|---|
| 17 | |
|---|
| 18 | int main(int argc, char* argv[]) |
|---|
| 19 | { |
|---|
| 20 | std::stringstream ss; |
|---|
| 21 | |
|---|
| 22 | const A a; |
|---|
| 23 | { |
|---|
| 24 | boost::archive::text_oarchive oa(ss); |
|---|
| 25 | oa << a; |
|---|
| 26 | } |
|---|
| 27 | A a1; |
|---|
| 28 | { |
|---|
| 29 | boost::archive::text_iarchive ia(ss); |
|---|
| 30 | ia >> a1; |
|---|
| 31 | } |
|---|
| 32 | return 0; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.