neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::optional< T > Class Template Reference

#include <optional.hpp>

Inheritance diagram for neolib::optional< T >:
neolib::reference_counted< i_optional< abstract_t< T > > > neolib::i_optional< abstract_t< T > > neolib::i_reference_counted

Public Types

typedef i_optional< abstract_t< T > > abstract_type
 
typedef std::optional< Tstd_type
 
typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef abstract_type::reference abstract_reference
 
typedef abstract_type::const_reference abstract_const_reference
 
- Public Types inherited from neolib::i_optional< abstract_t< T > >
typedef self_type abstract_type
 
typedef abstract_t< T > value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 

Public Member Functions

 optional ()
 
 optional (std::nullopt_t)
 
 optional (value_type const &other)
 
 optional (abstract_type const &other)
 
template<typename U , typename = std::enable_if_t<std::is_constructible_v<T, U>, sfinae>>
 optional (U const &value)
 
bool has_value () const noexcept final
 
 operator bool () const noexcept final
 
const std_typeas_std_optional () const
 
std_typeas_std_optional ()
 
std_type to_std_optional () const
 
reference value () final
 
const_reference value () const final
 
abstract_const_reference value_or (abstract_const_reference aDefaultValue) const final
 
abstract_const_reference value_or (abstract_reference aDefaultValue) const final
 
abstract_reference value_or (abstract_reference aDefaultValue) final
 
reference operator* () final
 
const_reference operator* () const final
 
pointer operator-> () final
 
const_pointer operator-> () const final
 
template<typename... Args>
referenceemplace (Args &&... args)
 
void reset () final
 
self_typeoperator= (std::nullopt_t) noexcept final
 
self_typeoperator= (const self_type &rhs)
 
self_typeoperator= (const abstract_type &rhs) final
 
self_typeoperator= (const abstract_t< T > &value) final
 
bool operator== (std::nullopt_t) const
 
bool operator!= (std::nullopt_t) const
 
bool operator== (const optional< T > &that) const
 
std::partial_ordering operator<=> (const optional< T > &that) const
 
- Public Member Functions inherited from neolib::reference_counted< i_optional< abstract_t< T > > >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_typerelease_and_take_ownership () const override
 
base_typerelease_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 
- Public Member Functions inherited from neolib::i_optional< abstract_t< T > >
virtual i_optional< abstract_t< T > > & operator= (const i_optional< abstract_t< T > > &rhs)=0
 
bool operator== (std::nullopt_t) const
 
bool operator== (const i_optional< abstract_t< T > > &that) const
 
bool operator!= (std::nullopt_t) const
 
std::partial_ordering operator<=> (const i_optional< abstract_t< T > > &that) const
 
- Public Member Functions inherited from neolib::i_reference_counted
virtual ~i_reference_counted ()=default
 

Detailed Description

template<typename T>
class neolib::optional< T >

Definition at line 54 of file optional.hpp.

Member Typedef Documentation

◆ abstract_const_reference

template<typename T >
typedef abstract_type::const_reference neolib::optional< T >::abstract_const_reference

Definition at line 67 of file optional.hpp.

◆ abstract_reference

template<typename T >
typedef abstract_type::reference neolib::optional< T >::abstract_reference

Definition at line 66 of file optional.hpp.

◆ abstract_type

template<typename T >
typedef i_optional<abstract_t<T> > neolib::optional< T >::abstract_type

Definition at line 59 of file optional.hpp.

◆ const_pointer

template<typename T >
typedef const value_type* neolib::optional< T >::const_pointer

Definition at line 63 of file optional.hpp.

◆ const_reference

template<typename T >
typedef const value_type& neolib::optional< T >::const_reference

Definition at line 65 of file optional.hpp.

◆ pointer

template<typename T >
typedef value_type* neolib::optional< T >::pointer

Definition at line 62 of file optional.hpp.

◆ reference

template<typename T >
typedef value_type& neolib::optional< T >::reference

Definition at line 64 of file optional.hpp.

◆ std_type

template<typename T >
typedef std::optional<T> neolib::optional< T >::std_type

Definition at line 60 of file optional.hpp.

◆ value_type

template<typename T >
typedef T neolib::optional< T >::value_type

Definition at line 61 of file optional.hpp.

Constructor & Destructor Documentation

◆ optional() [1/5]

template<typename T >
neolib::optional< T >::optional ( )
inline

Definition at line 70 of file optional.hpp.

◆ optional() [2/5]

template<typename T >
neolib::optional< T >::optional ( std::nullopt_t  )
inline

Definition at line 74 of file optional.hpp.

◆ optional() [3/5]

template<typename T >
neolib::optional< T >::optional ( value_type const other)
inline

Definition at line 78 of file optional.hpp.

◆ optional() [4/5]

template<typename T >
neolib::optional< T >::optional ( abstract_type const other)
inline

Definition at line 82 of file optional.hpp.

◆ optional() [5/5]

template<typename T >
template<typename U , typename = std::enable_if_t<std::is_constructible_v<T, U>, sfinae>>
neolib::optional< T >::optional ( U const value)
inline

Definition at line 88 of file optional.hpp.

Member Function Documentation

◆ as_std_optional() [1/2]

template<typename T >
std_type & neolib::optional< T >::as_std_optional ( )
inline

Definition at line 108 of file optional.hpp.

◆ as_std_optional() [2/2]

template<typename T >
const std_type & neolib::optional< T >::as_std_optional ( ) const
inline

Definition at line 104 of file optional.hpp.

◆ emplace()

template<typename T >
template<typename... Args>
reference & neolib::optional< T >::emplace ( Args &&...  args)
inline

Definition at line 166 of file optional.hpp.

◆ has_value()

template<typename T >
bool neolib::optional< T >::has_value ( ) const
inlinefinalvirtualnoexcept

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 94 of file optional.hpp.

◆ operator bool()

template<typename T >
neolib::optional< T >::operator bool ( ) const
inlineexplicitfinalvirtualnoexcept

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 98 of file optional.hpp.

◆ operator!=()

template<typename T >
bool neolib::optional< T >::operator!= ( std::nullopt_t  ) const
inline

Definition at line 206 of file optional.hpp.

◆ operator*() [1/2]

template<typename T >
const_reference neolib::optional< T >::operator* ( ) const
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 151 of file optional.hpp.

◆ operator*() [2/2]

template<typename T >
reference neolib::optional< T >::operator* ( )
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 147 of file optional.hpp.

◆ operator->() [1/2]

template<typename T >
const_pointer neolib::optional< T >::operator-> ( ) const
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 159 of file optional.hpp.

◆ operator->() [2/2]

template<typename T >
pointer neolib::optional< T >::operator-> ( )
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 155 of file optional.hpp.

◆ operator<=>()

template<typename T >
std::partial_ordering neolib::optional< T >::operator<=> ( const optional< T > &  that) const
inline

Definition at line 218 of file optional.hpp.

◆ operator=() [1/4]

template<typename T >
self_type & neolib::optional< T >::operator= ( const abstract_t< T > &  value)
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 196 of file optional.hpp.

◆ operator=() [2/4]

template<typename T >
self_type & neolib::optional< T >::operator= ( const abstract_type rhs)
inlinefinal

Definition at line 188 of file optional.hpp.

◆ operator=() [3/4]

template<typename T >
self_type & neolib::optional< T >::operator= ( const self_type rhs)
inline

Definition at line 180 of file optional.hpp.

◆ operator=() [4/4]

template<typename T >
self_type & neolib::optional< T >::operator= ( std::nullopt_t  )
inlinefinalvirtualnoexcept

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 175 of file optional.hpp.

◆ operator==() [1/2]

template<typename T >
bool neolib::optional< T >::operator== ( const optional< T > &  that) const
inline

Definition at line 210 of file optional.hpp.

◆ operator==() [2/2]

template<typename T >
bool neolib::optional< T >::operator== ( std::nullopt_t  ) const
inline

Definition at line 202 of file optional.hpp.

◆ reset()

template<typename T >
void neolib::optional< T >::reset ( )
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 171 of file optional.hpp.

◆ to_std_optional()

template<typename T >
std_type neolib::optional< T >::to_std_optional ( ) const
inline

Definition at line 112 of file optional.hpp.

◆ value() [1/2]

template<typename T >
const_reference neolib::optional< T >::value ( ) const
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 122 of file optional.hpp.

◆ value() [2/2]

template<typename T >
reference neolib::optional< T >::value ( )
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 118 of file optional.hpp.

◆ value_or() [1/3]

template<typename T >
abstract_const_reference neolib::optional< T >::value_or ( abstract_const_reference  aDefaultValue) const
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 126 of file optional.hpp.

◆ value_or() [2/3]

template<typename T >
abstract_const_reference neolib::optional< T >::value_or ( abstract_reference  aDefaultValue) const
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 133 of file optional.hpp.

◆ value_or() [3/3]

template<typename T >
abstract_reference neolib::optional< T >::value_or ( abstract_reference  aDefaultValue)
inlinefinalvirtual

Implements neolib::i_optional< abstract_t< T > >.

Definition at line 140 of file optional.hpp.


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