Skip to content

Comment on The missing C++ smart pointerparent

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.