| 1 | #include <common/iostream_debug_helpers.h> |
| 2 | |
| 3 | #include <iostream> |
| 4 | #include <memory> |
| 5 | #include <vector> |
| 6 | #include <map> |
| 7 | #include <set> |
| 8 | #include <tuple> |
| 9 | #include <array> |
| 10 | #include <utility> |
| 11 | |
| 12 | |
| 13 | struct S1; |
| 14 | struct S2 {}; |
| 15 | |
| 16 | struct S3 |
| 17 | { |
| 18 | std::set<const char *> m1; |
| 19 | }; |
| 20 | |
| 21 | std::ostream & operator<<(std::ostream & stream, const S3 & what) |
| 22 | { |
| 23 | stream << "S3 {m1=" ; |
| 24 | dumpValue(stream, what.m1) << "}" ; |
| 25 | return stream; |
| 26 | } |
| 27 | |
| 28 | int main(int, char **) |
| 29 | { |
| 30 | int x = 1; |
| 31 | |
| 32 | DUMP(x); |
| 33 | DUMP(x, 1, &x); |
| 34 | |
| 35 | DUMP(std::make_unique<int>(1)); |
| 36 | DUMP(std::make_shared<int>(1)); |
| 37 | |
| 38 | std::vector<int> vec{1, 2, 3}; |
| 39 | DUMP(vec); |
| 40 | |
| 41 | auto pair = std::make_pair(1, 2); |
| 42 | DUMP(pair); |
| 43 | |
| 44 | auto tuple = std::make_tuple(1, 2, 3); |
| 45 | DUMP(tuple); |
| 46 | |
| 47 | std::map<int, std::string> map{{1, "hello" }, {2, "world" }}; |
| 48 | DUMP(map); |
| 49 | |
| 50 | std::initializer_list<const char *> list{"hello" , "world" }; |
| 51 | DUMP(list); |
| 52 | |
| 53 | std::array<const char *, 2> arr{{"hello" , "world" }}; |
| 54 | DUMP(arr); |
| 55 | |
| 56 | //DUMP([]{}); |
| 57 | |
| 58 | S1 * s = nullptr; |
| 59 | DUMP(s); |
| 60 | |
| 61 | DUMP(S2()); |
| 62 | |
| 63 | std::set<const char *> variants = {"hello" , "world" }; |
| 64 | DUMP(variants); |
| 65 | |
| 66 | S3 s3 {{"hello" , "world" }}; |
| 67 | DUMP(s3); |
| 68 | |
| 69 | return 0; |
| 70 | } |
| 71 | |