3.2.5. Function.hpp

The class template Function is used throughout the library to represent function objects.

template<typename Sig>
class Function

3.2.5.1. Class template<typename R, typename ...Args> Function<R(Args...)>

template<typename R, typename ...Args>
class Function<R(Args...)>

Abstract base class template for function objects used in the library.

3.2.5.1.1. Synopsis

virtual std::shared_ptr<Function<R(Args...)>> clone() const = 0
virtual void print(std::ostream &s) const = 0
virtual R operator()(Args... args) const = 0

3.2.5.1.2. Details

virtual std::shared_ptr<Function<R(Args...)>> clone() const = 0

Cloning function used when a copy of a given functor is needed.

virtual void print(std::ostream &s) const = 0

Printing function used for describing the function in output from algorithms.

virtual R operator()(Args... args) const = 0

The actual function implementation of the function.