[Mod] updated autocxxpy: generate caster for only classes and enums

This commit is contained in:
nanoric 2019-07-05 09:58:10 +08:00
parent 9db0dfdcbb
commit 1e49a0aa1d

View File

@ -55,13 +55,14 @@ namespace autocxxpy
template <class to_type, class scope_type> template <class to_type, class scope_type>
static auto try_generate(scope_type &m, const char *name) static auto try_generate(scope_type &m, const char *name)
{ {
if constexpr (is_defined_v<to_type>) { if constexpr (std::is_class_v<to_type> || std::is_enum_v<to_type>) {
if constexpr (!std::is_array_v<to_type>) { if constexpr (is_defined_v<to_type>) {
if constexpr (std::is_default_constructible_v<to_type>) { if constexpr (!std::is_array_v<to_type>) {
generate_nocheck<to_type>(m, name); if constexpr (std::is_default_constructible_v<to_type>) {
generate_nocheck<to_type>(m, name);
}
} }
} }
} }
} }
private: private: