GDBserver
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gdb::optional< T > Class Template Reference

#include "gdb_optional.h"

Public Member Functions

constexpr optional ()
 
template<typename... Args>
constexpr optional (in_place_t, Args &&... args)
 
 ~optional ()
 
 optional (const optional &other)
 
 optional (optional &&other) noexcept(std::is_nothrow_move_constructible< T >())
 
constexpr optional (const T &other)
 
constexpr optional (T &&other) noexcept(std::is_nothrow_move_constructible< T >())
 
optionaloperator= (const optional &other)
 
optionaloperator= (optional &&other) noexcept(And< std::is_nothrow_move_constructible< T >, std::is_nothrow_move_assignable< T >>())
 
optionaloperator= (const T &other)
 
optionaloperator= (T &&other) noexcept(And< std::is_nothrow_move_constructible< T >, std::is_nothrow_move_assignable< T >>())
 
template<typename... Args>
T & emplace (Args &&... args)
 
constexpr const T * operator-> () const
 
T * operator-> ()
 
constexpr const T & operator* () const &
 
T & operator* () &
 
T && operator* () &&
 
constexpr const T && operator* () const &&
 
constexpr operator bool () const noexcept
 
constexpr bool has_value () const noexcept
 
void reset () noexcept
 

Private Member Functions

void destroy ()
 
T & get () noexcept
 
constexpr const T & get () const noexcept
 

Private Attributes

union {
   struct {
   }   m_dummy
 
   T   m_item
 
}; 
 
bool m_instantiated = false
 

Detailed Description

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

Definition at line 51 of file gdb_optional.h.

Constructor & Destructor Documentation

◆ optional() [1/6]

template<typename T >
constexpr gdb::optional< T >::optional ( )
inline

Definition at line 55 of file gdb_optional.h.

◆ optional() [2/6]

template<typename T >
template<typename... Args>
constexpr gdb::optional< T >::optional ( in_place_t  ,
Args &&...  args 
)
inline

Definition at line 60 of file gdb_optional.h.

◆ ~optional()

template<typename T >
gdb::optional< T >::~optional ( )
inline

Definition at line 65 of file gdb_optional.h.

References gdb::optional< T >::reset().

◆ optional() [3/6]

template<typename T >
gdb::optional< T >::optional ( const optional< T > &  other)
inline

◆ optional() [4/6]

template<typename T >
gdb::optional< T >::optional ( optional< T > &&  other)
inlinenoexcept

Definition at line 76 of file gdb_optional.h.

References gdb::optional< T >::emplace().

◆ optional() [5/6]

template<typename T >
constexpr gdb::optional< T >::optional ( const T &  other)
inline

Definition at line 83 of file gdb_optional.h.

◆ optional() [6/6]

template<typename T >
constexpr gdb::optional< T >::optional ( T &&  other)
inlinenoexcept

Definition at line 88 of file gdb_optional.h.

Member Function Documentation

◆ destroy()

template<typename T >
void gdb::optional< T >::destroy ( )
inlineprivate

◆ emplace()

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

◆ get() [1/2]

template<typename T >
T& gdb::optional< T >::get ( )
inlineprivatenoexcept

◆ get() [2/2]

template<typename T >
constexpr const T& gdb::optional< T >::get ( ) const
inlineprivatenoexcept

Definition at line 204 of file gdb_optional.h.

References gdb::optional< T >::m_item.

◆ has_value()

template<typename T >
constexpr bool gdb::optional< T >::has_value ( ) const
inlinenoexcept

Definition at line 182 of file gdb_optional.h.

References gdb::optional< T >::m_instantiated.

◆ operator bool()

template<typename T >
constexpr gdb::optional< T >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 179 of file gdb_optional.h.

References gdb::optional< T >::m_instantiated.

◆ operator*() [1/4]

template<typename T >
constexpr const T& gdb::optional< T >::operator* ( ) const &
inline

Definition at line 167 of file gdb_optional.h.

◆ operator*() [2/4]

template<typename T >
T& gdb::optional< T >::operator* ( ) &
inline

Definition at line 170 of file gdb_optional.h.

◆ operator*() [3/4]

template<typename T >
T&& gdb::optional< T >::operator* ( ) &&
inline

Definition at line 173 of file gdb_optional.h.

◆ operator*() [4/4]

template<typename T >
constexpr const T&& gdb::optional< T >::operator* ( ) const &&
inline

Definition at line 176 of file gdb_optional.h.

◆ operator->() [1/2]

template<typename T >
constexpr const T* gdb::optional< T >::operator-> ( ) const
inline

Definition at line 161 of file gdb_optional.h.

◆ operator->() [2/2]

template<typename T >
T* gdb::optional< T >::operator-> ( )
inline

Definition at line 164 of file gdb_optional.h.

◆ operator=() [1/4]

template<typename T >
optional& gdb::optional< T >::operator= ( const optional< T > &  other)
inline

◆ operator=() [2/4]

template<typename T >
optional& gdb::optional< T >::operator= ( optional< T > &&  other)
inlinenoexcept

◆ operator=() [3/4]

template<typename T >
optional& gdb::optional< T >::operator= ( const T &  other)
inline

◆ operator=() [4/4]

template<typename T >
optional& gdb::optional< T >::operator= ( T &&  other)
inlinenoexcept

◆ reset()

template<typename T >
void gdb::optional< T >::reset ( )
inlinenoexcept

Member Data Documentation

◆ @11

union { ... }

◆ m_dummy

struct { ... } gdb::optional< T >::m_dummy

◆ m_instantiated

template<typename T >
bool gdb::optional< T >::m_instantiated = false
private

◆ m_item

template<typename T >
T gdb::optional< T >::m_item

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