libsigc++ 3.6.0

Public Member Functions | Public Attributes | List of all members
sigc::adaptor_functor< T_functor > Struct Template Reference
Adaptors

Converts an arbitrary functor into an adaptor type. More...

`#include <sigc++/adaptors/adaptor_trait.h>`

Inheritance diagram for sigc::adaptor_functor< T_functor >:
[legend]

## Public Member Functions
| adaptor_functor ()=default
| Constructs an invalid functor.
| adaptor_functor (const T_functor &functor)
| Constructs an adaptor_functor object that wraps the passed functor.
template <typename T_type >
| adaptor_functor (const T_type & type)
| Constructs an adaptor_functor object that wraps the passed (member) function pointer.
decltype(auto) | operator() () const
| Invokes the wrapped functor passing on the arguments.
template<typename... T_arg>
decltype(auto) | operator() (T_arg &&... arg) const
| Invokes the wrapped functor passing on the arguments.

## Public Attributes
T_functor | functor_
| Functor that is invoked from operator()().

## Detailed Description

template <typename T_functor>
struct sigc::adaptor_functor< T_functor >

Converts an arbitrary functor into an adaptor type.

All adaptor types in libsigc++ have a `template operator()` member of every argument count they support. These functions in turn invoke a stored adaptor's `template operator()`, processing the arguments and return value in a characteristic manner. Explicit function template instantiation is used to pass type hints thus saving copy costs.

adaptor_functor is a glue between adaptors and arbitrary functors that just passes on the arguments. You won't use this type directly.

The template argument T_functor determines the type of stored functor.

## Constructor & Destructor Documentation

## ◆ adaptor_functor() [1/3]

template <typename T_functor >

sigc::adaptor_functor< T_functor >::adaptor_functor | ( |  | ) |
| default

Constructs an invalid functor.

## ◆ adaptor_functor() [2/3]

template <typename T_functor >

sigc::adaptor_functor< T_functor >::adaptor_functor | ( | const T_functor & | functor | ) |
| inline explicit

Constructs an adaptor_functor object that wraps the passed functor.

Parameters

  functor | Functor to invoke from operator()().

## ◆ adaptor_functor() [3/3]

template <typename T_functor >
template <typename T_type >

sigc::adaptor_functor< T_functor >::adaptor_functor | ( | const T_type & | type | ) |
| inline explicit

Constructs an adaptor_functor object that wraps the passed (member) function pointer.

Parameters

  type | Pointer to function or class method to invoke from operator()().

## Member Function Documentation

## ◆ operator()() [1/2]

template <typename T_functor >

decltype(auto) sigc::adaptor_functor< T_functor >::operator() | ( |  | ) | const
| inline

Invokes the wrapped functor passing on the arguments.

Returns
  The return value of the functor invocation.

## ◆ operator()() [2/2]

template <typename T_functor >
template <typename... T_arg>

decltype(auto) sigc::adaptor_functor< T_functor >::operator() | ( | T_arg &&... | arg | ) | const
| inline

Invokes the wrapped functor passing on the arguments.

Parameters

  arg | Arguments to be passed on to the functor.

Returns
  The return value of the functor invocation.

## Member Data Documentation

## ◆ functor_

template <typename T_functor >

T_functor sigc::adaptor_functor< T_functor >::functor_
| mutable

Functor that is invoked from operator()().