MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

tests/StructuredBindingsHandler6Test.cpp:55–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53};
54
55int main()
56{
57 Point p = Point{1, 2};
58 auto [x, y] = p;
59
60 printf("x:%lf y:%lf\n", p.GetX(), p.GetY());
61 printf("x:%lf y:%lf\n", x, y);
62
63 char ar[2]{7,8};
64 auto [a1, a2] = ar;
65 auto& [a4, a5] = ar;
66
67 printf("%d %d\n", a4, a5);
68 ++a4;
69 --a5;
70 printf("%d %d\n", a4, a5);
71
72 const auto& [a8, a9] = ar;
73
74 const char aa[2] = {1, 2};
75 const auto& [a18, a19] = aa;
76
77 auto muple = std::make_tuple(1, 'a', 2.3);
78
79 // unpack the tuple into its individual components
80 auto& [i, c, d] = muple;
81
82 auto [ii, cc, dd] = muple;
83}

Callers

nothing calls this directly

Calls 2

GetXMethod · 0.45
GetYMethod · 0.45

Tested by

no test coverage detected