Mark mjCError and mjXError as [[nodiscard]].

This lets the compiler catch the mistake of creating an exception without throwing it.

PiperOrigin-RevId: 474536776
Change-Id: I5bd18258ce6ddd266adb1c852b1ba9e3063cd0b2
This commit is contained in:
Nimrod Gileadi
2022-09-15 05:28:18 -07:00
committed by Copybara-Service
parent 0a0acb3419
commit c8517e63a4
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ typedef enum _mjtMeshType {
// error information
class mjCError {
class [[nodiscard]] mjCError {
public:
mjCError(const mjCBase* obj = 0,
const char* msg = 0,