On 03/13/2016 06:29 PM, Gavin Lambert wrote:
I'm not sure a new type is appropriate, since I thought part of the point was that consumers of the pointers don't know which one is the root, and separate arenas/proxies could end up getting merged based on usage. It just seems to be something required at construction time only.
It is possible to add the unification or proxies just like it was before but it won't be as clean as it is right now. I assume the C++ programmer knows how to program at a minimum. So I am trying to keep a balance here.
Also bear in mind that since people get into bad habits with passing smart pointers by value instead of by reference, any such type has to be slice-safe or you invite trouble. (ie. someone is going to construct a block_root_ptr and then pass it by value as a block_ptr, possibly destroying the original copy. In that second design, every single child block_ptr will explode at that point.)
I am not sure about all cases yet. I need to investigate.