Boost logo

Boost :

From: Дмитрий Архипов (grisumbras_at_[hidden])
Date: 2024-12-16 11:48:30


пн, 16 дек. 2024 г. в 13:36, Ivan Matek via Boost <boost_at_[hidden]>:
>
> 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?

In Boost.JSON I instead went for functions returning system::result
(e.g. https://www.boost.io/doc/libs/latest/libs/json/doc/html/json/ref/boost__json__object/try_at.html)
for several reasons:

1) JSON already had a dependency on System, but did not have a
dependency on Optional.
2) The function can fail for several reasons, and an error_code stored
in the result can communicate those reasons, while optional cannot
(e.g. see this:
https://www.boost.io/doc/libs/latest/libs/json/doc/html/json/ref/boost__json__value/try_at/overload1.html).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk