22 template<
typename... Ts>
27 struct any_bindables<T> : is_bindable<T> {
31 template<
typename HEAD,
typename... Ts>
32 struct any_bindables<HEAD, Ts...> : std::integral_constant<
34 any_bindables<HEAD>::value || any_bindables<Ts...>::value> {
54 #define KDBINDINGS_DECLARE_FUNCTION(NAME, FUNC) \
55 template<typename... Ts> \
56 inline auto NAME(Ts &&...args)->std::enable_if_t<::KDBindings::Private::any_bindables<Ts...>::value, ::KDBindings::Private::Node<::KDBindings::Private::operator_node_result_t<decltype(FUNC), Ts...>>> \
58 return ::KDBindings::Private::makeNode(FUNC, std::forward<Ts>(args)...); \
79 template<
typename... Ts>
82 return std::abs(std::forward<Ts>(x)...);
102 template<
typename... Ts> \
103 auto operator()(Ts &&...x)
const \
105 return FUNCTION(std::forward<Ts>(x)...); \
123 #define KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(NAMESPACE, NAME) \
124 KDBINDINGS_DECLARE_FUNCTION_OBJECT(node_##NAMESPACE_##NAME, NAMESPACE::NAME) \
125 KDBINDINGS_DECLARE_FUNCTION(NAME, node_##NAMESPACE_##NAME{})
136 #define KDBINDINGS_DECLARE_STD_FUNCTION(NAME) \
137 KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(std, NAME)
The main namespace of the KDBindings library.
#define KDBINDINGS_DECLARE_FUNCTION_OBJECT(NAME, FUNCTION)
This macro declares a callable struct that wraps a function with all its overloads.
#define KDBINDINGS_DECLARE_FUNCTION(NAME, FUNC)
KDBINDINGS_DECLARE_FUNCTION is a helper macro to declare and define functions for use in data binding...
#define KDBINDINGS_DECLARE_STD_FUNCTION(NAME)
This macro is based on KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(NAMESPACE, FUNC) to make it easier to d...
An example struct that is used with a call to KDBINDINGS_DECLARE_FUNCTION to declare all overloads of...
auto operator()(Ts &&...x) const
The operator() is overloaded so the struct can be used as a function object.