You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the error handling in the test back ends. Instead of throwing exceptions everywhere, try to gracefully handle errors and bubble them upwards. Considering using a utility macro for that.
I would be quite weary of macros, especially like the one you suggested that contains return.
Something like https://github.com/TartanLlama/optional could be better, but I would strongly prefer something that matches the names C++23 gives these functions (sadly C++23 is far away, we currently support GCC 9 and would need GCC 12+ to have these functions). I am little afraid it would lead to lambda mess, but in many cases it could probably work. When we would introduce a lib for such things, something akin to std::expected would be probably better than better optional.
I also would prefer the TartanLlama optional, especially because it also includes optional reference support, which is not coming to C++ any time soon. For expected expected-lite can be used because it has the same interface. But it does not come with the same kind of convenience functions the TartanLlama expected provides.
I could try incubating any of these on the P4Testgen side at least and then eventually contribute to the wider compiler infrastructure if it works out.
Improve the error handling in the test back ends. Instead of throwing exceptions everywhere, try to gracefully handle errors and bubble them upwards. Considering using a utility macro for that.
Originally posted by @vlstill in #4372 (comment)
The text was updated successfully, but these errors were encountered: