4 ms·
What the heck is this? y: ~~~~~Foo
by kirab 12y ago
What the heck is this?
y: ~~~~~Foo
- akavel 12y agoI assumed it reads more or less like: Foo *****y; Or, probably, more like: std::unique_ptr<std::unique_ptr<std::unique_ptr<std::unique_ptr<std::unique_ptr<Foo>>>>> y;
- alkonaut 12y agoy is a pointer to a pointer to a pointer to a pointer to a pointer to an instance of Foo. What the author wanted to show was that there is automatic dereference: z = y.foo() Will just reference through all five pointers and call the method on the object directly.
- masklinn 12y agoA pointer to a pointer to a pointer to a pointer to a pointer to a Foo.