Skip to content

KDBindings::node_abs

An example struct that is used with a call to KDBINDINGS_DECLARE_FUNCTION to declare all overloads of std::abs as usable in data binding. More...

#include <node_functions.h>

Public Functions

Name
template <typename... Ts>
auto
operator()(Ts &&... x) const
The operator() is overloaded so the struct can be used as a function object.

Detailed Description

1
struct KDBindings::node_abs;

An example struct that is used with a call to KDBINDINGS_DECLARE_FUNCTION to declare all overloads of std::abs as usable in data binding.

Because of the way node_abs overloads its operator(), it can be used in a call to KDBINDINGS_DECLARE_FUNCTION like this:

1
KDBINDINGS_DECLARE_FUNCTION(abs, node_abs{})

To generate such a struct for another function, use the KDBINDINGS_DECLARE_FUNCTION_OBJECT macro.

Public Functions Documentation

function operator()

1
2
3
4
template <typename... Ts>
inline auto operator()(
    Ts &&... x
) const

The operator() is overloaded so the struct can be used as a function object.

Because this operator is templated, a single instance of node_abs can refer to all overloads of std::abs.


Updated on 2022-04-12 at 00:03:54 +0000

Back to top