Calling functionsΒΆ

auto const call_unpack

Call a function with parameters taken from a range.

The range’s length and types must be known at compile time, like a tuple.

If no range is given, a lazy functor is returned which takes a range and then calls the function with it.

If the function should be called straight away, but with no arguments, then an empty tuple can be passed in.

  • function -

    The function (or function object) to be called. If no argument tuple is given, an rvalue function is stored as a value, and an lvalue reference function is stored as this reference.

  • arguments -

    (optional) The range with arguments that the function is called with.

template <class Callable, class... StoredArguments>
class range::callable::lazy

Store arguments for a callable object.

Class that can be called and called, and will store the arguments until it is called with a range, at which point it will call the Callable with the range as the first argument.

For example, lazy <callable::drop>() (4) (front) (range) is equivalent to drop (range, front, 4). lazy <callable::drop>() (4, front) (range) is too. The good thing about lazy functions is that they can be passed in as functors.

The arguments are stored by value and passed to the function by const reference.

  • Callable -

    The callable that will be default-constructed and called.

  • StoredArguments -

    The arguments stored so far.

Previous topic


Next topic

Computing hashes

This Page