FunInfo.hpp
Wrap a function to provide more information about it.
FunInfo will collect information about a provided function and facilitate manipulations.
Developer Notes:
Will not currently handle return by reference!
Note
Status: ALPHA
Functions
-
template<typename FUN_T, typename CONVERTER_T>
static auto ChangeReturnType(FUN_T fun, CONVERTER_T convert_fun) Change a function’s return type using a converter function.
-
template<typename NEW_T, typename FUN_T, typename CONVERTER_T>
static auto ChangeParameterTypes(FUN_T fun, CONVERTER_T convert_fun) Change a function’s arguments using a simple converter function.
-
template<typename NEW_T, typename FUN_T, typename CONVERTER_T>
static auto ConvertParameterTypes(FUN_T fun, CONVERTER_T convert_fun) Convert a function’s arguments using a templated lambda.
Note
: Will not work until C++20!!
-
template<typename NEW_T, typename FUN_T, typename R_CONVERTER_T, typename P_CONVERTER_T>
static auto ChangeTypes(FUN_T fun, R_CONVERTER_T ret_convert_fun, P_CONVERTER_T param_convert_fun) Convert both return type AND parameter type. Convert a function’s arguments using a templated lambda.
-
template<size_t POS, typename FUN_T, typename BOUND_T>
auto BindAt(FUN_T fun, BOUND_T &&bound) Lock in a specified argument of a function.
-
template<typename T>
struct FunInfo - #include <FunInfo.hpp>
-
template<typename RETURN_T, typename ...PARAM_Ts>
struct FunInfo<RETURN_T(PARAM_Ts...)> : public FunInfo<std::function<RETURN_T(PARAM_Ts...)>> - #include <FunInfo.hpp>
-
template<typename RETURN_T, typename ...PARAM_Ts>
struct FunInfo<RETURN_T (*)(PARAM_Ts...)> : public FunInfo<std::function<RETURN_T(PARAM_Ts...)>> - #include <FunInfo.hpp>
-
template<typename CLASS_T, typename RETURN_T, typename PARAM1_T, typename ...PARAM_Ts>
struct FunInfo<RETURN_T (CLASS_T::*)(PARAM1_T, PARAM_Ts...) const> - #include <FunInfo.hpp>
Public Types
Public Static Functions
-
template<typename ARG1, typename ...ARG_Ts>
static inline constexpr bool InvocableWith(ARG1&&, ARG_Ts&&...) Test if this function can be called with a particular set of arguments.
-
template<typename ...ARG_Ts>
static inline constexpr bool InvocableWith() Test if this function can be called with a particular set of argument TYPEs.
-
template<typename FUN_T, typename CONVERTER_T>
static inline auto ChangeReturnType(FUN_T fun, CONVERTER_T convert_fun) Change a function’s return type using a converter function.
-
template<typename NEW_T, typename FUN_T, typename CONVERTER_T>
static inline auto ChangeParameterTypes(FUN_T fun, CONVERTER_T convert_fun) Change a function’s arguments using a fixed converter function.
-
template<typename NEW_T, typename FUN_T, typename CONVERTER_T>
static inline auto ConvertParameterTypes(FUN_T fun, CONVERTER_T convert_lambda) Convert a function’s arguments using a dynamic (tempalted) lambda function.
-
template<typename ARG1, typename ...ARG_Ts>
-
template<typename CLASS_T, typename RETURN_T>
struct FunInfo<RETURN_T (CLASS_T::*)() const> - #include <FunInfo.hpp>
Public Static Functions
-
template<typename ...ARG_Ts>
static inline constexpr bool InvocableWith(ARG_Ts...) Test if this function can be called with a particular set of arguments.
-
template<typename FUN_T, typename CONVERTER_T>
static inline auto ChangeReturnType(FUN_T fun, CONVERTER_T convert_fun) Change a function’s return type using a converter function.
-
template<typename, typename FUN_T, typename CONVERTER_T>
static inline auto ChangeParameterTypes(FUN_T fun, CONVERTER_T) Change a function’s arguments using a converter function.
-
template<typename NEW_T, typename FUN_T, typename CONVERTER_T>
static inline auto ConvertParameterTypes(FUN_T fun, CONVERTER_T) Convert a function’s arguments using a dynamic (tempalted) lambda function.
Public Static Attributes
-
static constexpr size_t num_args = 0
-
template<typename ...ARG_Ts>