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
@@ -33,7 +33,7 @@ void mjCopyError(char* dst, const char* src, int maxlen);
// XML Error info
class mjXError {
class [[nodiscard]] mjXError {
public:
mjXError(const tinyxml2::XMLElement* elem = 0,
const char* msg = 0,