15 #include <type_traits>
22 struct bindable_value_type_ {
27 struct bindable_value_type_<Property<T>> {
32 struct bindable_value_type_<const Property<T>> {
37 struct bindable_value_type_<NodeInterface<T>> {
42 struct bindable_value_type_<Node<T>> {
47 struct bindable_value_type : bindable_value_type_<std::decay_t<T>> {
51 using bindable_value_type_t =
typename bindable_value_type<T>::type;
54 template<
typename Operator,
typename... Ts>
55 using operator_node_result =
58 std::decay_t<Operator>,
59 bindable_value_type_t<Ts>...>>;
61 template<
typename Operator,
typename... Ts>
62 using operator_node_result_t =
typename operator_node_result<Operator, Ts...>::type;
66 inline Node<std::decay_t<T>> makeNode(T &&value)
68 return Node<std::decay_t<T>>(std::make_unique<ConstantNode<std::decay_t<T>>>(std::move(value)));
72 inline Node<T> makeNode(Property<T> &property)
74 return Node<T>(std::make_unique<PropertyNode<T>>(property));
78 inline Node<T> makeNode(
const Property<T> &property)
80 return Node<T>(std::make_unique<PropertyNode<T>>(property));
84 inline Node<T> makeNode(Node<T> &&node)
86 return std::move(node);
89 template<
typename Operator,
typename... Ts,
typename = std::enable_if_t<
sizeof...(Ts) >= 1>,
typename ResultType = operator_node_result_t<Operator, Ts...>>
90 inline Node<ResultType> makeNode(Operator &&op, Ts &&...args)
92 return Node<ResultType>(std::make_unique<OperatorNode<ResultType, std::decay_t<Operator>, bindable_value_type_t<Ts>...>>(
93 std::forward<Operator>(op),
94 makeNode(std::forward<Ts>(args))...));
99 struct is_bindable : std::integral_constant<
101 is_property<T>::value || is_node<T>::value> {
The main namespace of the KDBindings library.