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

Attribute value reference implementation for multiple types 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

void reset () BOOST_NOEXCEPT
 Resets the reference. 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...
 
template<typename U >
enable_if< is_compatible< U >
, U const & >::type 
get () const BOOST_NOEXCEPT
 Returns a reference to the value. More...
 
unsigned int which () const BOOST_NOEXCEPT
 Returns the stored type index. More...
 
void swap (variant_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...
 

Protected Types

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

Protected Member Functions

 variant_ref () BOOST_NOEXCEPT
 Default constructor. More...
 
template<typename U >
 variant_ref (const U *p) BOOST_NOEXCEPT
 Initializing constructor. More...
 

Protected Attributes

const void * m_ptr
 Pointer to the value. More...
 
unsigned int m_type_idx
 Type index. More...
 

Detailed Description

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

Attribute value reference implementation for multiple types case.

Member Typedef Documentation

template<typename T , typename TagT >
template<typename U >
using boost::aux::variant_ref< T, TagT >::is_compatible = mpl::contains< value_type, U >
protected

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

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

Tag type.

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

Referenced value type.

Constructor & Destructor Documentation

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

Default constructor.

template<typename T , typename TagT >
template<typename U >
boost::aux::variant_ref< T, TagT >::variant_ref ( const U *  p)
inlineexplicitprotected

Initializing constructor.

Member Function Documentation

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

Applies a visitor function object to the referred value.

References BOOST_ASSERT.

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

Applies a visitor function object to the referred value.

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

Applies a visitor function object to the referred value.

template<typename T , typename TagT >
template<typename VisitorT , typename DefaultT >
VisitorT::result_type boost::aux::variant_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.

template<typename T , typename TagT >
template<typename VisitorT , typename DefaultT >
VisitorT::result_type boost::aux::variant_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.

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

Returns a reference to the value.

References BOOST_ASSERT, and boost::multiprecision::backends::p.

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

Returns a pointer to the referred value.

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

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

Resets the reference.

template<typename T , typename TagT >
void boost::aux::variant_ref< T, TagT >::swap ( variant_ref< T, TagT > &  that)
inline
template<typename T , typename TagT >
unsigned int boost::aux::variant_ref< T, TagT >::which ( ) const
inline

Returns the stored type index.

References boost::aux::variant_ref< T, TagT >::m_type_idx.

Member Data Documentation

template<typename T , typename TagT >
const void* boost::aux::variant_ref< T, TagT >::m_ptr
protected
template<typename T , typename TagT >
unsigned int boost::aux::variant_ref< T, TagT >::m_type_idx
protected

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