Last active
January 1, 2016 03:43
-
-
Save xaxxon/97c75218891e439ce147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename ... CONSTRUCTOR_PARAMETER_TYPES> | |
static void v8_constructor(const v8::FunctionCallbackInfo<v8::Value>& args) { | |
T * new_cpp_object = call_cpp_constructor<CONSTRUCTOR_PARAMETER_TYPES...>(args, std::index_sequence_for<CONSTRUCTOR_PARAMETER_TYPES...>()); | |
// other stuff in here removed | |
} | |
template <typename ...Fs, size_t...ns, class WHY> | |
static T * call_cpp_constructor(const WHY & args, std::index_sequence<ns...>){ | |
return new T(CastToNative<Fs>()(args[ns])...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment