From b00bd59027ae2f90281d276b05f672f9dc0abf4b Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 24 May 2024 17:12:22 +0200 Subject: [PATCH] Don't fail when no default ctor is given --- include/wrenpp/detail/construct_foreign_class.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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}; + } } } };