Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::reference_wrapper< T > Singleton Reference

Contains a reference to an object of type T. More...

#include <parameters.hpp>

Inheritance diagram for boost::reference_wrapper< T >:

Public Types

typedef T type
 Type T. More...
 

Public Member Functions

BOOST_FORCEINLINE reference_wrapper (T &t)
 Constructs a reference_wrapper object that stores a reference to t. More...
 
BOOST_FORCEINLINE operator T & () const
 
BOOST_FORCEINLINE Tget () const
 
BOOST_FORCEINLINE Tget_pointer () const
 

Detailed Description

template<class T>
singleton boost::reference_wrapper< T >

Contains a reference to an object of type T.

reference_wrapper is primarily used to "feed" references to function templates (algorithms) that take their parameter by value. It provides an implicit conversion to T&, which usually allows the function templates to work on references unmodified.

Member Typedef Documentation

template<class T>
typedef T boost::reference_wrapper< T >::type

Type T.

Constructor & Destructor Documentation

template<class T>
BOOST_FORCEINLINE boost::reference_wrapper< T >::reference_wrapper ( T t)
inlineexplicit

Constructs a reference_wrapper object that stores a reference to t.

Remarks
Does not throw.

Member Function Documentation

template<class T>
BOOST_FORCEINLINE T& boost::reference_wrapper< T >::get ( ) const
inline
Returns
The stored reference.
Remarks
Does not throw.

Referenced by boost::spirit::karma::reference< Subject >::generate(), boost::BOOST_SIGNALS_NAMESPACE::get_inspectable_slot(), boost::multi_index::const_mem_fun< Class, Type, PtrToMemberFunction >::operator()(), boost::multi_index::detail::const_identity_base< Type >::operator()(), boost::multi_index::detail::const_member_base< Class, Type, PtrToMember >::operator()(), boost::multi_index::mem_fun< Class, Type, PtrToMemberFunction >::operator()(), boost::multi_index::detail::non_const_member_base< Class, Type, PtrToMember >::operator()(), boost::multi_index::detail::non_const_identity_base< Type >::operator()(), boost::multi_index::detail::non_ref_global_fun_base< Value, Type, PtrToFunction >::operator()(), boost::multi_index::const_mem_fun_explicit< Class, Type, PtrToMemberFunctionType, PtrToMemberFunction >::operator()(), boost::multi_index::detail::const_member_offset_base< Class, Type, OffsetOfMember >::operator()(), boost::multi_index::mem_fun_explicit< Class, Type, PtrToMemberFunctionType, PtrToMemberFunction >::operator()(), boost::multi_index::detail::non_const_member_offset_base< Class, Type, OffsetOfMember >::operator()(), boost::spirit::qi::make_primitive< reference< symbols< Char, T, Lookup, Filter > >, Modifiers >::operator()(), boost::multi_index::composite_key< Value, >::operator()(), boost::spirit::karma::make_primitive< reference< symbols< Attribute, T, Lookup, CharEnconding, Tag > >, Modifiers >::operator()(), boost::_bi::list0::operator[](), boost::_bi::list1< A1 >::operator[](), boost::_bi::list2< A1, A2 >::operator[](), boost::_bi::list3< A1, A2, A3 >::operator[](), boost::_bi::list4< A1, A2, A3, A4 >::operator[](), boost::_bi::list5< A1, A2, A3, A4, A5 >::operator[](), boost::_bi::list6< A1, A2, A3, A4, A5, A6 >::operator[](), boost::_bi::list7< A1, A2, A3, A4, A5, A6, A7 >::operator[](), boost::_bi::list8< A1, A2, A3, A4, A5, A6, A7, A8 >::operator[](), boost::_bi::list9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >::operator[](), boost::spirit::qi::reference< Subject >::parse(), boost::_bi::unwrapper< F >::unwrap(), boost::spirit::qi::reference< Subject >::what(), and boost::spirit::karma::reference< Subject >::what().

template<class T>
BOOST_FORCEINLINE T* boost::reference_wrapper< T >::get_pointer ( ) const
inline
Returns
A pointer to the object referenced by the stored reference.
Remarks
Does not throw.

Referenced by boost::detail::function::BOOST_JOIN(), boost::phoenix::detail::compare::operator()(), and boost::_bi::ref_compare().

template<class T>
BOOST_FORCEINLINE boost::reference_wrapper< T >::operator T & ( ) const
inline
Remarks
Construction from a temporary object is disabled.
Returns
The stored reference.
Remarks
Does not throw.

The documentation for this singleton was generated from the following file: