I was trying to creating a red-black tree, and when trying to get data out of it, it always returned the same value, so i decided to try to create a very simple binary search tree, and i got the same result, so i wonder, ¿what i’m doing wrong when trying to create trees in c++? Here is the code: https://pastebin.com/L2yJJ3Nu
It’s been a while since I did c++.
Does make_shared make a copy of the object and return a shared pointer to it, or does it read the memory location of the variable passed to it? The node is being created on the stack, which in this simple application will likely always be at the same memory location.
yup, it does that