
pon., 16 gru 2024 o 11:36 Ivan Matek via Boost
Hi everybody,
I presume somebody thought of this before but for some reason it never happened, but just in case it was never discussed I wonder if people here believe adding an nicer version of find(with different name obviously) to associative containers in boost would be beneficial?
Since boost::optional allows references this would work.
It does, but conceptually optional
I presume naming is what most people will have strong feeling about. I personally prefer ofind/oat since I love short names, Barry suggested different names in his blog https://brevzin.github.io/c++/2023/05/23/map-api/, e.g. try_at.
"Oat" seems particularly funny.
boost::optional did not get all the updates C++23 std::optional got, e.g. transform that make this usage compose nicely, but those could be added to boost::optional.
Note that boost::optional has had the "monadic interface" for a while. https://www.boost.org/doc/libs/1_87_0/libs/optional/doc/html/boost_optional/... It just uses a different name (map) as at the time we were adding it, a monadic interface in std::optional was not a thing. Regards, &rzej;
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost