Skip to content

Comment on The missing C++ smart pointerparent

Comments

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.