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:
committed by
Copybara-Service
parent
0a0acb3419
commit
c8517e63a4
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user