Add const to mjsDefault when used as function argument.

Fixes #2197.

PiperOrigin-RevId: 692346264
Change-Id: Iddb9be1377a7d59c86911802d8c5563f6bf6b043
This commit is contained in:
Alessio Quaglino
2024-11-01 18:17:42 -07:00
committed by Copybara-Service
parent 47ebb0614e
commit ebe60b9ad5
8 changed files with 102 additions and 111 deletions
+1 -1
View File
@@ -346,7 +346,7 @@ PYBIND11_MODULE(_specs, m) {
py::return_value_policy::reference_internal);
mjSpec.def(
"find_default",
[](MjSpec& self, std::string& classname) -> raw::MjsDefault* {
[](MjSpec& self, std::string& classname) -> const raw::MjsDefault* {
return mjs_findDefault(self.ptr, classname.c_str());
},
py::return_value_policy::reference_internal);