Typically, C ++ objects are not intended to be removed from the container. Instead, the container (in this case, your binary tree) is considered the owner of the object. The destructor is called when the container decides to remove the node (presumably based on some request from your code).
Having a pointer to the root of the binary tree will violate encapsulation. Ideally, you would like your object to be inserted into another container, such as a vector. For example, the standard type std::string has no idea what it can be inserted into. Its destructor is only responsible for cleaning things within itself.
source share