1 | #include <cstdint> |
---|---|
2 | #include <cstdio> |
3 | |
4 | struct Foo { |
5 | uint32_t func() const & { return 0; } |
6 | int64_t func() const && { return 1; } |
7 | uint32_t func() & { return 2; } |
8 | int64_t func() && { return 3; } |
9 | }; |
10 | |
11 | int main() { |
12 | Foo foo; |
13 | const Foo const_foo; |
14 | auto res = foo.func() + const_foo.func() + Foo{}.func() + |
15 | static_cast<Foo const &&>(Foo{}).func(); |
16 | |
17 | std::puts(s: "Break here"); |
18 | return res; |
19 | } |
20 |