4 ms·
"do programmers in other languages use 'railway' style error handling." I use that in C++. Basically I define a templated return type that can be parametrized
by fsloth 3y ago
"do programmers in other languages use 'railway' style error handling."
I use that in C++. Basically I define a templated return type that can be parametrized using the return type T and the specific enumeration definining the result condition. Although you can do with std::pair<MyValue, std::string> In a pinch, where you return any error statements in the string and exit early if the string is non-empty (when all functions return types like that you can then bubble up the error statement up to top level).