Main Page Groups Namespaces

# reference_wrapper.h File Reference

## Namespaces

namespace | sigc

## Functions

template<class T_type>
reference_wrapper<T_type> | ref (T_type& v)
| Creates a reference wrapper.
template<class T_type>
const_reference_wrapper<T_type> | ref (const T_type& v)
| Creates a const reference wrapper.
template<class T_type>
T_type& | unwrap (const reference_wrapper<T_type>& v)
template<class T_type>
const T_type& | unwrap (const const_reference_wrapper<T_type>& v)

## Function Documentation

template <class T_type>
const_reference_wrapper<T_type> ref | ( | const T_type& | v | ) |

Creates a const reference wrapper.

Passing an object throught sigc::ref() makes libsigc++ adaptors like, e.g., sigc::bind store references to the object instead of copies. If the object type inherits from sigc::trackable this will ensure automatic invalidation of the adaptors when the object is deleted or overwritten.

Parameters:

  | v | Reference to store.

Returns:
  A reference wrapper.

template <class T_type>
reference_wrapper<T_type> ref | ( | T_type& | v | ) |

Creates a reference wrapper.

Passing an object throught sigc::ref() makes libsigc++ adaptors like, e.g., sigc::bind store references to the object instead of copies. If the object type inherits from sigc::trackable this will ensure automatic invalidation of the adaptors when the object is deleted or overwritten.

Parameters:

  | v | Reference to store.

Returns:
  A reference wrapper.

template <class T_type>
const T_type& unwrap | ( | const const_reference_wrapper<T_type>& | v | ) |

template <class T_type>
T_type& unwrap | ( | const reference_wrapper<T_type>& | v | ) |