← Back to context Comment by drysine 12 hours ago And developers never forget to check error codes. 3 comments drysine Reply listeria 3 hours ago may I introduce you to the nodiscard attribute[1]? enum (class)? [[nodiscard]] Error { Ok, NoMem, ... }; [1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc... drysine 3 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar... dan00 7 hours ago Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.Also error codes are part of the signature of a function, which exceptions aren‘t.
listeria 3 hours ago may I introduce you to the nodiscard attribute[1]? enum (class)? [[nodiscard]] Error { Ok, NoMem, ... }; [1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc... drysine 3 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar...
drysine 3 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar...
dan00 7 hours ago Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.Also error codes are part of the signature of a function, which exceptions aren‘t.
may I introduce you to the nodiscard attribute[1]?
[1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc...
[1] https://en.cppreference.com/w/c/language/attributes/nodiscar...
Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.
Also error codes are part of the signature of a function, which exceptions aren‘t.