Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
Public Member Functions
ext::optional_ref< T > Class Template Reference

#include <optional_ref.hpp>

Public Member Functions

 optional_ref ()
 
 optional_ref (std::nullopt_t)
 
 optional_ref (T &val)
 
template<class U >
 optional_ref (const optional_ref< U > &other)
 
template<class U >
 optional_ref (optional_ref< U > &&other)
 
optional_refoperator= (const optional_ref &)=delete
 
optional_refoperator= (optional_ref &&)=delete
 
 optional_ref (const optional_ref &other)=default
 
 optional_ref (optional_ref &&other) noexcept=default
 
 ~optional_ref () noexcept=default
 
const T * operator-> () const
 
T * operator-> ()
 
const T & operator* () const &
 
T & operator* () &
 
const T && operator* () const &&
 
T && operator* () &&
 
 operator bool () const noexcept
 
bool has_value () const noexcept
 
T & value () &
 
const T & value () const &
 
T && value () &&
 
const T && value () const &&
 
const T & value_or (const T &default_value) const &
 
T & value_or (T &default_value) &
 
T && value_or (T &&default_value) &&
 
bool operator== (const optional_ref< T > &rhs) const
 Compares two optional_ref instances for equvalence. More...
 
auto operator<=> (const optional_ref< T > &rhs) const
 Compares two optional_ref instances by less relation. More...
 

Constructor & Destructor Documentation

◆ optional_ref() [1/7]

template<class T >
ext::optional_ref< T >::optional_ref ( )
inline

◆ optional_ref() [2/7]

template<class T >
ext::optional_ref< T >::optional_ref ( std::nullopt_t  )
inline

◆ optional_ref() [3/7]

template<class T >
ext::optional_ref< T >::optional_ref ( T &  val)
inline

◆ optional_ref() [4/7]

template<class T >
template<class U >
ext::optional_ref< T >::optional_ref ( const optional_ref< U > &  other)
inline

◆ optional_ref() [5/7]

template<class T >
template<class U >
ext::optional_ref< T >::optional_ref ( optional_ref< U > &&  other)
inline

◆ optional_ref() [6/7]

template<class T >
ext::optional_ref< T >::optional_ref ( const optional_ref< T > &  other)
default

◆ optional_ref() [7/7]

template<class T >
ext::optional_ref< T >::optional_ref ( optional_ref< T > &&  other)
defaultnoexcept

◆ ~optional_ref()

template<class T >
ext::optional_ref< T >::~optional_ref ( )
defaultnoexcept

Member Function Documentation

◆ has_value()

template<class T >
bool ext::optional_ref< T >::has_value ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ operator bool()

template<class T >
ext::optional_ref< T >::operator bool ( ) const
inlineexplicitnoexcept
Here is the call graph for this function:

◆ operator*() [1/4]

template<class T >
T & ext::optional_ref< T >::operator* ( ) &
inline
Here is the call graph for this function:

◆ operator*() [2/4]

template<class T >
T && ext::optional_ref< T >::operator* ( ) &&
inline
Here is the call graph for this function:

◆ operator*() [3/4]

template<class T >
const T & ext::optional_ref< T >::operator* ( ) const &
inline
Here is the call graph for this function:

◆ operator*() [4/4]

template<class T >
const T && ext::optional_ref< T >::operator* ( ) const &&
inline
Here is the call graph for this function:

◆ operator->() [1/2]

template<class T >
T * ext::optional_ref< T >::operator-> ( )
inline

◆ operator->() [2/2]

template<class T >
const T * ext::optional_ref< T >::operator-> ( ) const
inline

◆ operator<=>()

template<class T >
auto ext::optional_ref< T >::operator<=> ( const optional_ref< T > &  rhs) const
inline

Compares two optional_ref instances by less relation.

Parameters
lhsthe first instance to compare
rhsthe second instance to compare
Returns
true if the first compared instance is less than the other instance, false othervise
Here is the call graph for this function:

◆ operator=() [1/2]

template<class T >
optional_ref & ext::optional_ref< T >::operator= ( const optional_ref< T > &  )
delete

◆ operator=() [2/2]

template<class T >
optional_ref & ext::optional_ref< T >::operator= ( optional_ref< T > &&  )
delete

◆ operator==()

template<class T >
bool ext::optional_ref< T >::operator== ( const optional_ref< T > &  rhs) const
inline

Compares two optional_ref instances for equvalence.

Parameters
lhsthe first instance to compare
rhsthe second instance to compare
Returns
true if the two compared instance are equal, false othervise
Here is the call graph for this function:

◆ value() [1/4]

template<class T >
T & ext::optional_ref< T >::value ( ) &
inline
Here is the caller graph for this function:

◆ value() [2/4]

template<class T >
T && ext::optional_ref< T >::value ( ) &&
inline

◆ value() [3/4]

template<class T >
const T & ext::optional_ref< T >::value ( ) const &
inline

◆ value() [4/4]

template<class T >
const T && ext::optional_ref< T >::value ( ) const &&
inline

◆ value_or() [1/3]

template<class T >
const T & ext::optional_ref< T >::value_or ( const T &  default_value) const &
inline
Here is the call graph for this function:

◆ value_or() [2/3]

template<class T >
T && ext::optional_ref< T >::value_or ( T &&  default_value) &&
inline
Here is the call graph for this function:

◆ value_or() [3/3]

template<class T >
T & ext::optional_ref< T >::value_or ( T &  default_value) &
inline
Here is the call graph for this function:

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