1 | // See http://www.boost.org for most recent version, including documentation. |
2 | // |
3 | // Copyright Antony Polukhin, 2020. |
4 | // |
5 | // Distributed under the Boost |
6 | // Software License, Version 1.0. (See accompanying file |
7 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). |
8 | |
9 | #ifndef BOOST_LEXICAL_CAST_TEST_ESCAPE_STRUCT_HPP_ |
10 | #define BOOST_LEXICAL_CAST_TEST_ESCAPE_STRUCT_HPP_ |
11 | |
12 | #include <istream> |
13 | #include <ostream> |
14 | |
15 | struct EscapeStruct |
16 | { |
17 | EscapeStruct() {} |
18 | EscapeStruct(const std::string& s) |
19 | : str_(s) |
20 | {} |
21 | |
22 | std::string str_; |
23 | }; |
24 | |
25 | inline std::ostream& operator<< (std::ostream& o, const EscapeStruct& rhs) |
26 | { |
27 | return o << rhs.str_; |
28 | } |
29 | |
30 | inline std::istream& operator>> (std::istream& i, EscapeStruct& rhs) |
31 | { |
32 | return i >> rhs.str_; |
33 | } |
34 | |
35 | |
36 | #endif // BOOST_LEXICAL_CAST_TEST_ESCAPE_STRUCT_HPP_ |
37 | |