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

Attribute value reference implementation for a single type case. More...

#include <value_ref.hpp>

Public Types

typedef T value_type
 Referenced value type. More...
 
typedef TagT tag_type
 Tag type. More...
 

Public Member Functions

const value_typeoperator-> () const BOOST_NOEXCEPT
 Returns a pointer to the referred value. More...
 
const value_typeget_ptr () const BOOST_NOEXCEPT
 Returns a pointer to the referred value. More...
 
template<typename U >
enable_if< is_compatible< U >
, const U * >::type 
get_ptr () const BOOST_NOEXCEPT
 Returns a pointer to the referred value. More...
 
value_type const & operator* () const BOOST_NOEXCEPT
 Returns a reference to the value. More...
 
value_type const & get () const BOOST_NOEXCEPT
 Returns a reference to the value. More...
 
template<typename U >
enable_if< is_compatible< U >
, U const & >::type 
get () const BOOST_NOEXCEPT
 Returns a reference to the value. More...
 
void reset () BOOST_NOEXCEPT
 Resets the reference. More...
 
void swap (singular_ref &that) BOOST_NOEXCEPT
 Swaps two reference wrappers. More...
 
template<typename VisitorT >
VisitorT::result_type apply_visitor (VisitorT visitor) const
 Applies a visitor function object to the referred value. More...
 
template<typename VisitorT >
enable_if< is_void< typename
VisitorT::result_type >, bool >
::type 
apply_visitor_optional (VisitorT visitor) const
 Applies a visitor function object to the referred value. More...
 
template<typename VisitorT >
disable_if< is_void< typename
VisitorT::result_type >
, optional< typename
VisitorT::result_type >
>::type 
apply_visitor_optional (VisitorT visitor) const
 Applies a visitor function object to the referred value. More...
 
template<typename VisitorT , typename DefaultT >
VisitorT::result_type apply_visitor_or_default (VisitorT visitor, DefaultT &def_val) const
 Applies a visitor function object to the referred value or returns a default value. More...
 
template<typename VisitorT , typename DefaultT >
VisitorT::result_type apply_visitor_or_default (VisitorT visitor, DefaultT const &def_val) const
 Applies a visitor function object to the referred value or returns a default value. More...
 

Static Public Member Functions

static BOOST_CONSTEXPR unsigned int which ()
 Returns the stored type index. More...
 

Protected Types

template<typename U >
using is_compatible = is_same< U, value_type >
 The metafunction tests if the type is compatible with the reference wrapper. More...
 

Protected Member Functions

 singular_ref () BOOST_NOEXCEPT
 Default constructor. More...
 
 singular_ref (const value_type *p) BOOST_NOEXCEPT
 Initializing constructor. More...
 

Protected Attributes

const value_typem_ptr
 Pointer to the value. More...
 

Detailed Description

template<typename T, typename TagT>
class boost::aux::singular_ref< T, TagT >

Attribute value reference implementation for a single type case.

Member Typedef Documentation

template<typename T , typename TagT >
template<typename U >
using boost::aux::singular_ref< T, TagT >::is_compatible = is_same< U, value_type >
protected

The metafunction tests if the type is compatible with the reference wrapper.

template<typename T , typename TagT >
typedef TagT boost::aux::singular_ref< T, TagT >::tag_type

Tag type.

template<typename T , typename TagT >
typedef T boost::aux::singular_ref< T, TagT >::value_type

Referenced value type.

Constructor & Destructor Documentation

template<typename T , typename TagT >
boost::aux::singular_ref< T, TagT >::singular_ref ( )
inlineprotected

Default constructor.

template<typename T , typename TagT >
boost::aux::singular_ref< T, TagT >::singular_ref ( const value_type p)
inlineexplicitprotected

Initializing constructor.

Member Function Documentation

template<typename T , typename TagT >
template<typename VisitorT >
VisitorT::result_type boost::aux::singular_ref< T, TagT >::apply_visitor ( VisitorT  visitor) const
inline

Applies a visitor function object to the referred value.

References BOOST_ASSERT, and boost::visitor().

template<typename T , typename TagT >
template<typename VisitorT >
enable_if< is_void< typename VisitorT::result_type >, bool >::type boost::aux::singular_ref< T, TagT >::apply_visitor_optional ( VisitorT  visitor) const
inline

Applies a visitor function object to the referred value.

References boost::visitor().

template<typename T , typename TagT >
template<typename VisitorT >
disable_if< is_void< typename VisitorT::result_type >, optional< typename VisitorT::result_type > >::type boost::aux::singular_ref< T, TagT >::apply_visitor_optional ( VisitorT  visitor) const
inline

Applies a visitor function object to the referred value.

References boost::visitor().

template<typename T , typename TagT >
template<typename VisitorT , typename DefaultT >
VisitorT::result_type boost::aux::singular_ref< T, TagT >::apply_visitor_or_default ( VisitorT  visitor,
DefaultT &  def_val 
) const
inline

Applies a visitor function object to the referred value or returns a default value.

References boost::visitor().

template<typename T , typename TagT >
template<typename VisitorT , typename DefaultT >
VisitorT::result_type boost::aux::singular_ref< T, TagT >::apply_visitor_or_default ( VisitorT  visitor,
DefaultT const &  def_val 
) const
inline

Applies a visitor function object to the referred value or returns a default value.

References boost::visitor().

template<typename T , typename TagT >
value_type const& boost::aux::singular_ref< T, TagT >::get ( ) const
inline

Returns a reference to the value.

References BOOST_ASSERT, and boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
template<typename U >
enable_if< is_compatible< U >, U const& >::type boost::aux::singular_ref< T, TagT >::get ( ) const
inline

Returns a reference to the value.

References BOOST_ASSERT, and boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
const value_type* boost::aux::singular_ref< T, TagT >::get_ptr ( ) const
inline

Returns a pointer to the referred value.

References boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
template<typename U >
enable_if< is_compatible< U >, const U* >::type boost::aux::singular_ref< T, TagT >::get_ptr ( ) const
inline

Returns a pointer to the referred value.

References boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
value_type const& boost::aux::singular_ref< T, TagT >::operator* ( ) const
inline

Returns a reference to the value.

References BOOST_ASSERT, and boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
const value_type* boost::aux::singular_ref< T, TagT >::operator-> ( ) const
inline

Returns a pointer to the referred value.

References BOOST_ASSERT, and boost::aux::singular_ref< T, TagT >::m_ptr.

template<typename T , typename TagT >
void boost::aux::singular_ref< T, TagT >::reset ( void  )
inline

Resets the reference.

template<typename T , typename TagT >
void boost::aux::singular_ref< T, TagT >::swap ( singular_ref< T, TagT > &  that)
inline
template<typename T , typename TagT >
static BOOST_CONSTEXPR unsigned int boost::aux::singular_ref< T, TagT >::which ( )
inlinestatic

Returns the stored type index.

Member Data Documentation


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