16 template <
class T,
class =
void>
18 std::result_of_t<CastToNative<T>(v8::Isolate *,
v8::Local<v8::Value>)>
operator()(
const v8::FunctionCallbackInfo<v8::Value> & info,
int i)
const {
19 std::cerr << fmt::format(
"") << std::endl;
21 "requires {} but only {} were specified, missing {}",
22 i+1, info.Length(), demangle<T>()));
31 T &&
operator()(
const v8::FunctionCallbackInfo<v8::Value> & info,
int i)
const {
37 template<
class T,
int default_arg_position = -1,
class DefaultArgsTuple = std::tuple<>>
38 T *
get_default_parameter(
const v8::FunctionCallbackInfo<v8::Value> & info,
int & i, std::vector<std::unique_ptr<StuffBase>> & stuff,
39 DefaultArgsTuple && default_args_tuple) {
42 if constexpr(default_arg_position >= 0) {
43 return &std::get<default_arg_position>(default_args_tuple);
44 }
else if constexpr(cast_to_native_supports_default_value_v<T>) {
46 return static_cast<Stuff<T>&
>(stuff.back()).
get();
48 throw CastException(
"No default value available for type {}", demangle<T>());