diff --git a/examples/math_vector/main.cpp b/examples/math_vector/main.cpp index 742f491..a99df27 100644 --- a/examples/math_vector/main.cpp +++ b/examples/math_vector/main.cpp @@ -108,6 +108,7 @@ System.print("vec_base_x modified by scripting: <%(vec_base_x.x), %(vec_base_x.y int main() { using wren::make_function_bindable; using wren::make_foreign_class; + using wren::ConstructorParameters; MyConf conf; wren::VM vm(&conf, nullptr); @@ -123,8 +124,8 @@ int main() { vm.class_manager() .add_class_maker("math_vector", "MathVector", make_foreign_class, double, //single value constructor - std::tuple, //x,y,z constructor - std::tuple<> //default constructor + ConstructorParameters, //x,y,z constructor + ConstructorParameters<> //default constructor >); vm.interpret("main", g_test_script); diff --git a/include/wrenpp/detail/construct_foreign_class.hpp b/include/wrenpp/detail/construct_foreign_class.hpp index 615a3be..58d1803 100644 --- a/include/wrenpp/detail/construct_foreign_class.hpp +++ b/include/wrenpp/detail/construct_foreign_class.hpp @@ -23,11 +23,12 @@ # include "guess_class_name.hpp" #endif #include -#include #include #include namespace wren { + template struct ConstructorParameters { }; + namespace detail { template inline void construct_single ( @@ -46,13 +47,13 @@ namespace wren { template struct ForeignClassHelper; - template class Pack, typename... PackArgs, typename... Args> - struct ForeignClassHelper, Args...> { + template + struct ForeignClassHelper, Args...> { static ConstructResult construct (VM& vm, int cardinality, void* memory) { using std::make_integer_sequence; //search by number of parameters. - //once we find a tuple-like parameter that contains the right + //once we find a ConstructorParameters that contains the right //number of types we invoke construct_single() with those types. constexpr int pack_size = static_cast(sizeof...(PackArgs)); if (pack_size == cardinality) {