Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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