
On Thu, Dec 19, 2024 at 10:06 AM Peter Dimov via Boost < boost@lists.boost.org> wrote:
Vinnie Falco wrote:
On Thu, Dec 19, 2024 at 7:30 AM Christian Mazakas via Boost < boost@lists.boost.org> wrote:
users.find(user_id).map([](auto& user) { user.status = deactivated; return user; });
try_find( users, user_id ).map( [](auto& user) { user.status = deactivated; return user; });
In what namespace and in what header is try_find defined?
Haven't thought about this and here's a guess: #include <boost/try_find.hpp> ... boost::try_find( users, user_id ).map( [](auto& user) { user.status = deactivated; return user; }); In this case `try_find` would return `boost::optional`. And `std::try_find` could return `std::optional`. Thanks