I am reading the (otherwise excellent) The C++ Programming Language (4th edition - Hardcover) (Stroustrup) and I cannot understand about 4 pages of it despite a lot of attention to it.
It's section 27.4.1 Composing Data Structures starting page 767.
After reviewing obviously unsatisfactory alternatives on page 767 for a tree structure, the author propose on the next page (768) a very complicated structure for obscure incomprehensible reasons.
Why not just use the following (apparently satisfactory) structure, that would likely be the first to come to mind to any programmer approaching the case:
template <typename DATA>
struct node{
node <DATA> * left;
node <DATA> * right;
DATA data;
};
No need of base class. No need of recursive base class (!!!!! why ????). Full access to data from the node.
What am I missing?