Based on a recent discussion that was left out of scope of #128, there was an idea to make ->parent() return a Node rather than require callers to use shared_from_this (or intrusive_ptr_from_this now).
This PR makes that change. It:
changes parent() to return Node
adds parent_unsafe() that keeps old behavior if you don't want refcounting overheads and you know your borrow is safe
Point of discussion: what do we do with original calls to parent? Do all those calls in YAML change type, or do we make them parent_unsafe? I'm told it might have performance implications. So far, I only made ->parent()->intrusive_ptr_from_this() into ->parent() and otherwise went the unsafe route, but there's plenty of room for "don't care keep it simple" in other cases.
There's also a quick fix here for the test cases breaking in dependent projects, since this whole conversation is part of updating rego-cpp's dependencies. If this takes too long I can split that out. Moved to another PR
Based on a recent discussion that was left out of scope of #128, there was an idea to make
->parent()
return aNode
rather than require callers to useshared_from_this
(orintrusive_ptr_from_this
now).This PR makes that change. It:
parent()
to returnNode
parent_unsafe()
that keeps old behavior if you don't want refcounting overheads and you know your borrow is safePoint of discussion: what do we do with original calls to
parent
? Do all those calls in YAML change type, or do we make themparent_unsafe
? I'm told it might have performance implications. So far, I only made->parent()->intrusive_ptr_from_this()
into->parent()
and otherwise went the unsafe route, but there's plenty of room for "don't care keep it simple" in other cases.There's also a quick fix here for the test cases breaking in dependent projects, since this whole conversation is part of updating rego-cpp's dependencies. If this takes too long I can split that out.Moved to another PR