|
From: | nine . fierce . ballads |
Subject: | Re: Issue 5310: find_top_context () maintenance (issue 341150043 by address@hidden) |
Date: | Thu, 12 Dec 2019 15:59:29 -0800 |
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 https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-ptr-ref F.44: Return a T& when copy is undesirable and “returning no object” isn’t needed https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-return-ref 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 support. https://codereview.appspot.com/341150043/
[Prev in Thread] | Current Thread | [Next in Thread] |