diff --git a/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp b/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp index da3b5329..8ab6d79f 100644 --- a/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp +++ b/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp @@ -55,13 +55,14 @@ namespace autocxxpy template static auto try_generate(scope_type &m, const char *name) { - if constexpr (is_defined_v) { - if constexpr (!std::is_array_v) { - if constexpr (std::is_default_constructible_v) { - generate_nocheck(m, name); + if constexpr (std::is_class_v || std::is_enum_v) { + if constexpr (is_defined_v) { + if constexpr (!std::is_array_v) { + if constexpr (std::is_default_constructible_v) { + generate_nocheck(m, name); + } } } - } } private: