11#ifndef CHAISCRIPT_FUNCTION_CALL_HPP_
12#define CHAISCRIPT_FUNCTION_CALL_HPP_
41 template<
typename FunctionType>
44 const bool has_arity_match = std::any_of(funcs.begin(), funcs.end(),
46 return f->get_arity() == -1 || size_t(f->get_arity()) == chaiscript::dispatch::detail::Arity<FunctionType>::arity;
49 if (!has_arity_match) {
53 FunctionType *p=
nullptr;
68 template<
typename FunctionType>
76 template<
typename FunctionType>
85 template<
typename Signature>
100 template<
typename Signature>
115 template<
typename Signature>
P func(int c, EveryApi &ev)
Definition test.cpp:59
A wrapper for holding any valid C++ type. All types in ChaiScript are Boxed_Value objects.
Definition boxed_value.hpp:28
const Type_Info & get_type_info() const noexcept
Definition boxed_value.hpp:224
Definition type_conversions.hpp:512
constexpr bool bare_equal(const Type_Info &ti) const noexcept
Definition type_info.hpp:75
Thrown in the event that a Boxed_Value cannot be cast to the desired type.
Definition bad_boxed_cast.hpp:34
void function(void)
Definition memory_leak_test.cpp:26
Classes and functions reserved for internal use. Items in this namespace are not supported.
std::function< Ret(Params...)> build_function_caller_helper(Ret(Params...), const std::vector< Const_Proxy_Function > &funcs, const Type_Conversions_State *t_conversions)
Definition function_call_detail.hpp:146
Classes and functions specific to the runtime dispatch side of ChaiScript. Some items may be of use t...
Definition callable_traits.hpp:13
std::function< FunctionType > functor(const std::vector< Const_Proxy_Function > &funcs, const Type_Conversions_State *t_conversions)
Definition function_call.hpp:42
Namespace chaiscript contains every API call that the average user will be concerned with.
std::shared_ptr< const dispatch::Proxy_Function_Base > Const_Proxy_Function
Const version of Proxy_Function. Points to a const Proxy_Function. This is how most registered functi...
Definition proxy_functions.hpp:321
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
static std::function< Signature > cast(const Boxed_Value &ob, const Type_Conversions_State *t_conversions)
Definition function_call.hpp:118
static std::function< Signature > cast(const Boxed_Value &ob, const Type_Conversions_State *t_conversions)
Definition function_call.hpp:88
static std::function< Signature > cast(const Boxed_Value &ob, const Type_Conversions_State *t_conversions)
Definition function_call.hpp:103
Generic Cast_Helper_Inner, for casting to any type.
Definition boxed_cast_helper.hpp:76
The exposed Cast_Helper object that by default just calls the Cast_Helper_Inner.
Definition boxed_cast_helper.hpp:313
static decltype(auto) cast(const Boxed_Value &ob, const Type_Conversions_State *t_conversions)
Definition boxed_cast_helper.hpp:314