4 ms·
It looks like it’s basically a less hacky version of what the RETURN_IF_ERROR and ASSIGN_OR_RETURN macros[1] do in C++. From experience, those work pretty well
by alexhutcheson 7y ago
It looks like it’s basically a less hacky version of what the RETURN_IF_ERROR and ASSIGN_OR_RETURN macros[1] do in C++.
From experience, those work pretty well. That approach eliminates a lot of the boilerplate bookkeeping code, while still making it explicitly obvious to the reader that a given function call can fail.
This seems nice, and I would definitely use it.
[1] https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/stubs/status_macros.h https://github.com/protocolbuffers/protobuf/blob/master/src/...