11#ifndef CHAISCRIPT_PROXY_FUNCTIONS_DETAIL_HPP_
12#define CHAISCRIPT_PROXY_FUNCTIONS_DETAIL_HPP_
44 :
std::range_error(
"Function dispatch arity mismatch"),
66 template<
typename Ret,
typename ... Params>
79 template<
typename Ret,
typename ... Params>
84 std::vector<Boxed_Value>::size_type i = 0;
86 (void)params; (void)t_conversions;
88 (void)std::initializer_list<int>{(
boxed_cast<Params>(params[i++], &t_conversions), 0)...};
96 template<
typename Callable,
typename Ret,
typename ... Params,
size_t ... I>
98 std::index_sequence<I...>,
const Callable &
f,
101 (void)params; (void)t_conversions;
110 template<
typename Callable,
typename Ret,
typename ... Params>
117 template<
typename Callable,
typename ... Params>
121 call_func(sig, std::index_sequence_for<Params...>{},
f, params, t_conversions);
122#ifdef CHAISCRIPT_MSVC
124#pragma warning(disable : 4702)
128#ifdef CHAISCRIPT_MSVC
A wrapper for holding any valid C++ type. All types in ChaiScript are Boxed_Value objects.
Definition boxed_value.hpp:28
Definition type_conversions.hpp:512
Thrown in the event that a Boxed_Value cannot be cast to the desired type.
Definition bad_boxed_cast.hpp:34
Classes and functions reserved for internal use. Items in this namespace are not supported.
Ret call_func(const chaiscript::dispatch::detail::Function_Signature< Ret(Params...)> &, std::index_sequence< I... >, const Callable &f, const std::vector< Boxed_Value > ¶ms, const Type_Conversions_State &t_conversions)
Definition proxy_functions_detail.hpp:97
std::vector< Type_Info > build_param_type_list(Ret(*)(Params...))
Definition proxy_functions_detail.hpp:67
bool compare_types_cast(Ret(*)(Params...), const std::vector< Boxed_Value > ¶ms, const Type_Conversions_State &t_conversions)
Definition proxy_functions_detail.hpp:80
Classes and functions specific to the runtime dispatch side of ChaiScript. Some items may be of use t...
Definition callable_traits.hpp:13
Classes which may be thrown during error cases when ChaiScript is executing.
Definition bad_boxed_cast.hpp:27
Namespace chaiscript contains every API call that the average user will be concerned with.
constexpr Type_Info user_type(const T &)
Creates a Type_Info object representing the type passed in.
Definition type_info.hpp:221
decltype(auto) boxed_cast(const Boxed_Value &bv, const Type_Conversions_State *t_conversions=nullptr)
Function for extracting a value stored in a Boxed_Value object.
Definition boxed_cast.hpp:76
double f(const std::string &, double, bool) noexcept
Definition profile_cpp_calls_2.cpp:4
Definition GameApi_bm.cc:4579
Definition callable_traits.hpp:78
static Boxed_Value handle(T r)
Definition handle_return.hpp:40
int expected
Definition proxy_functions_detail.hpp:54
~arity_error() noexcept override=default
int got
Definition proxy_functions_detail.hpp:53
arity_error(const arity_error &)=default
arity_error(int t_got, int t_expected)
Definition proxy_functions_detail.hpp:43