Skip to content

Commit

Permalink
[Mod] updated autocxxpy: generate caster for only classes and enums
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoric committed Jul 5, 2019
1 parent 9db0dfd commit 1e49a0a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ namespace autocxxpy
template <class to_type, class scope_type>
static auto try_generate(scope_type &m, const char *name)
{
if constexpr (is_defined_v<to_type>) {
if constexpr (!std::is_array_v<to_type>) {
if constexpr (std::is_default_constructible_v<to_type>) {
generate_nocheck<to_type>(m, name);
if constexpr (std::is_class_v<to_type> || std::is_enum_v<to_type>) {
if constexpr (is_defined_v<to_type>) {
if constexpr (!std::is_array_v<to_type>) {
if constexpr (std::is_default_constructible_v<to_type>) {
generate_nocheck<to_type>(m, name);
}
}
}

}
}
private:
Expand Down

0 comments on commit 1e49a0a

Please sign in to comment.