|
|
|
|
|
by mathstuf
1369 days ago
|
|
The fact that `std::optional<T&>` is verbotten makes them quite a bit more useless. The Boost one is better because it doesn't have this misguided limitation. It's really quite a sad story and a loss to all of C++ that it is this way (and not for lack of trying on ThePhD's part). > no alternative but to return these more complicated things that users are then obliged to unpack Yes, thank you. It is much better this way. I think "substantial overhead" needs to be backed up with some numbers here because setting up exception landing pads is certainly not free. |
|
I prefer result style error handling personally and I am not suggesting that it's worse or shouldn't be used, just thought the findings were interesting and worth considering.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p25...