libabigail
Loading...
Searching...
No Matches
optional< T > Class Template Reference

Simplified implementation of std::optional just enough to be used as a replacement for our purposes and when compiling with pre C++17. More...

#include <abg-cxx-compat.h>

Public Member Functions

 optional (const T &value)
 
bool has_value () const noexcept
 
 operator bool () const noexcept
 
T & operator* () &noexcept
 
const T & operator* () const &noexcept
 
const T * operator-> () const noexcept
 
T * operator-> () noexcept
 
optionaloperator= (const T &value)
 
const T & value () const
 
const T value_or (const T &default_value) const
 

Detailed Description

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

Simplified implementation of std::optional just enough to be used as a replacement for our purposes and when compiling with pre C++17.

The implementation intentionally does not support a whole lot of features to minimize the maintenance effort with this.

Definition at line 38 of file abg-cxx-compat.h.

Constructor & Destructor Documentation

◆ optional() [1/2]

template<typename T >
optional ( )
inline

Definition at line 44 of file abg-cxx-compat.h.

◆ optional() [2/2]

template<typename T >
optional ( const T & value)
inline

Definition at line 45 of file abg-cxx-compat.h.

Member Function Documentation

◆ has_value()

template<typename T >
bool has_value ( ) const
inlinenoexcept

Definition at line 48 of file abg-cxx-compat.h.

◆ operator bool()

template<typename T >
operator bool ( ) const
inlineexplicitnoexcept

Definition at line 93 of file abg-cxx-compat.h.

◆ operator*() [1/2]

template<typename T >
T & operator* ( ) &
inlinenoexcept

Definition at line 74 of file abg-cxx-compat.h.

◆ operator*() [2/2]

template<typename T >
const T & operator* ( ) const &
inlinenoexcept

Definition at line 70 of file abg-cxx-compat.h.

◆ operator->() [1/2]

template<typename T >
const T * operator-> ( ) const
inlinenoexcept

Definition at line 78 of file abg-cxx-compat.h.

◆ operator->() [2/2]

template<typename T >
T * operator-> ( )
inlinenoexcept

Definition at line 82 of file abg-cxx-compat.h.

◆ operator=()

template<typename T >
optional & operator= ( const T & value)
inline

Definition at line 86 of file abg-cxx-compat.h.

◆ value()

template<typename T >
const T & value ( ) const
inline

Definition at line 54 of file abg-cxx-compat.h.

◆ value_or()

template<typename T >
const T value_or ( const T & default_value) const
inline

Definition at line 62 of file abg-cxx-compat.h.


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