Re: Issue 5310: find_top_context () maintenance (issue 341150043 by

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Issue 5310: find_top_context () maintenance (issue 341150043 by

Coming back to this after a long time...

I intend to abandon the pointer/reference changes and submit a new
review covering just the second point: "Call find_top_context () rather
than get_global_context () where the
   caller uses the result as a mere Context."

Those interested in the pointer/reference issue can find some discussion
in the C++ Core Guidelines maintained by Stroustrup and Sutter:

     F.60: Prefer T* over T& when “no argument” is a valid option

     F.44: Return a T& when copy is undesirable and “returning no object”
isn’t needed

There is also a related "Guidelines Support Library" that provides a
not_null<> wrapper that limits the use of pointers that are expected not
to be null.  It is licensed under the MIT license and assumes C++14