flex_function.hpp
Based on std::function, but holds default parameter values for calls with fewer args.
Note
Status: ALPHA
-
template<class R, class ...ARGS>
class flex_function<R(ARGS...)> - #include <flex_function.hpp>
A functon class that is almost identical to std::function, but is provided with default values for all parameters so that it can be called with fewer arguments, as needed.
Public Types
-
using this_t = flex_function<R(ARGS...)>
Public Functions
-
flex_function() = default
-
template<int ID>
inline void SetDefault(pack_id<ID, ARGS...> &in_default) Set the default value for a specific parameter.
-
template<class ...IN_ARGS>
inline return_t operator()(IN_ARGS&&... k) const All the function to be called with a subset of arguments (and the rest set to defaults)
-
inline operator bool() const
Determine whether this function has been set.
-
using this_t = flex_function<R(ARGS...)>