
On Fri, Jul 18, 2025 at 1:26 PM Andrey Semashev via Boost < boost@lists.boost.org> wrote:
Yes. I wasn't suggesting it to be a member function. I believe, a free function was one of the alternatives discussed in this thread, and that would be my preference, if it is to be added at all.
Yes, I think we have discussed this before in this thread, and by we I do not mean just you and me, many people. My preference for member function is unwavering but no need to rehash old talking points, unless you feel something was not clear/discussed so I will focus on "news".
News since this discussion in 2024: 1. C++26 will get optional<T&> (meaning the complaint about Cartesian product of container x optional is reduced since we now have vocabulary std::optional working as needed, so there is no longer this issue. Although linear amount of work(adding member fn to each container) remains and users will need to compile with C++26. 2. C++29 will most likely get get member function. github issues: std::optional<T&> <https://github.com/cplusplus/papers/issues/1661> Better lookups for map and unordered_map <https://github.com/cplusplus/papers/issues/1759>