
On Thu, 25 Mar 2021 23:37:46 -0700 "Gregory P. Smith" <greg@krypto.org> wrote:
On Thu, Mar 25, 2021 at 11:58 AM Mark Shannon <mark@hotpy.org> wrote:
Hi Victor,
I'm with you 100% on not returning borrowed references, doing so is just plain dangerous.
However, is a blanket ban on stealing references the right thing?
Maybe the problem is the term "stealing". The caller is transferring the reference to the callee. In some circumstances it can make a lot of sense to do so, since the caller has probably finished with the reference and the callee needs a new one.
Cheers, Mark.
When was the last time a non-internal API that transferred references added?
I suggest keeping the restriction on new APIs in place until we actually find a situation where we think we "need" one outside of Include/internal/ to help force the discussion as to why that needs to be public.
+1. Regards Antoine.