>>103238183
this is how we do error handling in a no exception C++ codebase, but the difference is we have a
CHECK(…) type macro that takes a std::expected<T,E> and returns early like this code is doing. The idea is fine, but manually having to write the conditionals after each function is stupid. It would look better like
std::expected<int, void> f() {
CHECK(a());
CHECK(b());
CHECK(c());
return 69;
}
I think that Zig has something like this built in? Not sure.
}