libsigc++ 2.12.0
Public Member Functions | List of all members
sigc::bound_argument< T_type > Class Template Reference

A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return()) argument. More...

#include <sigc++/adaptors/bound_argument.h>

Public Member Functions

 bound_argument (const T_type & _A_argument)
 Constructor. More...
 
T_type & invoke ()
 Retrieve the entity to pass to the bound functor or return. More...
 
const T_type & visit () const
 Retrieve the entity to visit in visit_each(). More...
 

Detailed Description

template<class T_type>
class sigc::bound_argument< T_type >

A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return()) argument.

If Foo is a wrapped reference to a class Bar (reference_wrapper<Bar>) then this object is implemented on top of a limit_reference. When the slot is invoked, the limit_reference::invoke() method provides the argument (a Bar&). When the slot is visited (e.g. visit_each<>()), we simply visit the limit_reference, which will visit the derived type, or a sigc::trackable base if necessary.

Likewise, If Foo is a wrapped const reference to a class Bar (const_reference_wrapper<Bar>) then this object is implemented on top of a const_limit_reference.

If Foo is something else (such as an argument that is bound by value) bound_argument just stores a cop of that value, and both invoke() and visit() simply return it.

This object is used by the bind_functor<> and bind_return_functor<> objects, depending on whether the argument is bound as a parameter or as a return value.

The general template implementation is used for parameters that are passed by value. T_type The type of the bound argument.

Constructor & Destructor Documentation

◆ bound_argument()

template <class T_type >
sigc::bound_argument< T_type >::bound_argument ( const T_type &  _A_argument)
inline

Constructor.

Parameters
_A_argumentThe argument to bind.

Member Function Documentation

◆ invoke()

template <class T_type >
T_type & sigc::bound_argument< T_type >::invoke ( )
inline

Retrieve the entity to pass to the bound functor or return.

Returns
The bound argument.

◆ visit()

template <class T_type >
const T_type & sigc::bound_argument< T_type >::visit ( ) const
inline

Retrieve the entity to visit in visit_each().

Returns
The bound argument.