diff --git a/include/wrenpp/detail/construct_foreign_class.hpp b/include/wrenpp/detail/construct_foreign_class.hpp index 58d1803..de749ad 100644 --- a/include/wrenpp/detail/construct_foreign_class.hpp +++ b/include/wrenpp/detail/construct_foreign_class.hpp @@ -76,7 +76,12 @@ namespace wren { return ConstructResult{1, true}; } else { - return ForeignClassHelper::construct(vm, cardinality, memory); + if constexpr (sizeof...(Args) > 0) { + return ForeignClassHelper::construct(vm, cardinality, memory); + } + else { + return ConstructResult{0, false}; + } } } };