MCPcopy Create free account
hub / github.com/boostorg/pfr / main

Function main

example/sample_printing.cpp:64–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62#include <sstream>
63
64int 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}

Callers

nothing calls this directly

Calls 1

my_ioFunction · 0.85

Tested by

no test coverage detected