Comment on The missing C++ smart pointerparentComments−gumby3yI understand that fine. My problem is the author calls out the “raw value” as distinct from “raw pointer”, implying a non pointer value which would be the content of a tree node. This makes the entire paragraph hard to make sense of.−maattddOP3yWe don't care about the content of the node. The interesting part is how do you define the Node itself.struct Node<T> { Node<T> left; Node<T> right; };would obviously be the best choice (what I call in the article "raw value"). But it's not valid C++.−gumby3yAh, thanks.
Comments
I understand that fine. My problem is the author calls out the “raw value” as distinct from “raw pointer”, implying a non pointer value which would be the content of a tree node. This makes the entire paragraph hard to make sense of.
We don't care about the content of the node. The interesting part is how do you define the Node itself.
struct Node<T> { Node<T> left; Node<T> right; };
would obviously be the best choice (what I call in the article "raw value"). But it's not valid C++.
Ah, thanks.