|
|
|
|
|
by ncmncm
1369 days ago
|
|
Option and Result types are as easily coded in C++. The former is in the Standard C++ library. The latter will be in the next, but anyway the one in Boost has worked fine forever. Throwing, instead, is a choice unavailable to Rust coders, so you often have no alternative but to return these more complicated things that users are then obliged to unpack. A standard macro makes that easier, and is semantically equivalent to throwing, but imposes substantial overhead on successful calls. |
|
> 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.