re: Elegant Error Handling with C++ VIEW POST


That's a good option for functions that would not return anything real, except a success indication. For other functions I really like to use std::optional to handle possible failures. This does not offer a way to tell the caller what went wrong, but there a lots of situations where that is not necessary.

code of conduct - report abuse