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

Reference wrapper for a stored attribute value. More...

#include <value_ref_fwd.hpp>

Inheritance diagram for boost::value_ref< T, TagT >:
Collaboration diagram for boost::value_ref< T, TagT >:

Public Types

typedef void _has_basic_formatting_ostream_insert_operator
 
typedef T type
 

Public Member Functions

 BOOST_DEFAULTED_FUNCTION (value_ref(value_ref const &that), BOOST_NOEXCEPT:base_type(static_cast< base_type const & >(that)){}) template< typename U > explicit value_ref(U const &val
 Default constructor. More...
 

Detailed Description

template<typename T, typename TagT>
singleton boost::value_ref< T, TagT >

Reference wrapper for a stored attribute value.

The value_ref class template provides access to the stored attribute value. It is not a traditional reference wrapper since it may be empty (i.e. refer to no value at all) and it can also refer to values of different types. Therefore its interface and behavior combines features of Boost.Ref, Boost.Optional and Boost.Variant, depending on the use case.

The template parameter T can be a single type or an MPL sequence of possible types being referred. The reference wrapper will act as either an optional reference or an optional variant of references to the specified types. In any case, the referred values will not be modifiable (i.e. value_ref always models a const reference).

Template parameter TagT is optional. It can be used for customizing the operations on this reference wrapper, such as putting the referred value to log.

Member Typedef Documentation

template<typename T, typename TagT>
typedef void boost::value_ref< T, TagT >::_has_basic_formatting_ostream_insert_operator
typedef T boost::mpl::identity< BOOST_MPL_AUX_NA_PARAM >::type
inherited

Member Function Documentation

template<typename T, typename TagT>
boost::value_ref< T, TagT >::BOOST_DEFAULTED_FUNCTION ( value_ref< T, TagT >(value_ref< T, TagT > const &that)  ,
BOOST_NOEXCEPT:base_type(static_cast< base_type const & >(that)){}   
) const

Default constructor.

Creates a reference wrapper that does not refer to a value.

Copy constructor.

Initializing constructor. Creates a reference wrapper that refers to the specified value.


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