| 62 | #include <sstream> |
| 63 | |
| 64 | int main() { |
| 65 | struct foo {std::uint8_t a, b;}; |
| 66 | |
| 67 | std::ostringstream oss; |
| 68 | oss << my_ns::my_io(foo{42, 22}); |
| 69 | |
| 70 | if (oss.str() != "42, 22") { |
| 71 | return 1; |
| 72 | } |
| 73 | |
| 74 | struct two_big_strings { |
| 75 | std::string first; |
| 76 | std::string second; |
| 77 | }; |
| 78 | |
| 79 | #if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE |
| 80 | const char* huge_string = "Some huge string that should not fit into std::string SSO." |
| 81 | "And by 'huge' I mean really HUGE string with multiple statements and a lot of periods........." |
| 82 | ; |
| 83 | |
| 84 | oss.str({}); |
| 85 | oss << my_ns::my_io(two_big_strings{ |
| 86 | huge_string, huge_string |
| 87 | }); |
| 88 | |
| 89 | if (oss.str() != huge_string + std::string(", ") + huge_string) { |
| 90 | return 2; |
| 91 | } |
| 92 | #endif |
| 93 | |
| 94 | return 0; |
| 95 | } |