diff --git a/vnpy/api/oes/include/autocxxpy/property_helper.hpp b/vnpy/api/oes/include/autocxxpy/property_helper.hpp index 00773161..fa020113 100644 --- a/vnpy/api/oes/include/autocxxpy/property_helper.hpp +++ b/vnpy/api/oes/include/autocxxpy/property_helper.hpp @@ -15,7 +15,7 @@ namespace autocxxpy template struct get_string { - auto &operator()(string_literal &val) + auto &operator()(string_literal &val) const noexcept { return val; } @@ -38,7 +38,7 @@ namespace autocxxpy template inline constexpr auto default_getter_wrap(value_type class_type::*member) { // match normal case - return [member](const class_type &instance)->const value_type & { + return [member](class_type &instance)->const value_type & { return instance.*member; }; } @@ -62,8 +62,8 @@ namespace autocxxpy template inline constexpr auto default_getter_wrap(literal_array class_type::*member) { // match get any [] - return [member](const class_type &instance) { - auto es = std::vector(size); + return [member](class_type &instance) { + auto es = std::vector(size); for (size_t i = 0; i < size ; i++) { es[i] = instance.*member + i; @@ -92,7 +92,7 @@ namespace autocxxpy template inline constexpr auto default_getter_wrap(literal_array class_type::*member) { // match get (any *)[] - return [member](const class_type &instance) { + return [member](class_type &instance) { std::vector arr; for (auto &v : instance.*member) { @@ -106,7 +106,7 @@ namespace autocxxpy template inline constexpr auto default_getter_wrap(string_literal class_type::*member) { // match get char [] - return [member](const class_type &instance) { + return [member](class_type &instance) { return get_string{}(instance.*member); }; }