ESPHome  2024.10.3
Public Types | Public Member Functions
esphome::optional< T > Class Template Reference

#include <optional.h>

Public Types

using value_type = T
 

Public Member Functions

 optional ()
 
 optional (nullopt_t)
 
 optional (T const &arg)
 
template<class U >
 optional (optional< U > const &other)
 
optionaloperator= (nullopt_t)
 
template<class U >
optionaloperator= (optional< U > const &other)
 
void swap (optional &rhs)
 
value_type const * operator-> () const
 
value_typeoperator-> ()
 
value_type const & operator* () const
 
value_typeoperator* ()
 
 operator safe_bool () const
 
bool has_value () const
 
value_type const & value () const
 
value_typevalue ()
 
template<class U >
value_type value_or (U const &v) const
 
void reset ()
 

Detailed Description

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

Definition at line 36 of file optional.h.

Member Typedef Documentation

◆ value_type

template<typename T>
using esphome::optional< T >::value_type = T

Definition at line 41 of file optional.h.

Constructor & Destructor Documentation

◆ optional() [1/4]

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

Definition at line 43 of file optional.h.

◆ optional() [2/4]

template<typename T>
esphome::optional< T >::optional ( nullopt_t  )
inline

Definition at line 45 of file optional.h.

◆ optional() [3/4]

template<typename T>
esphome::optional< T >::optional ( T const &  arg)
inline

Definition at line 47 of file optional.h.

◆ optional() [4/4]

template<typename T>
template<class U >
esphome::optional< T >::optional ( optional< U > const &  other)
inline

Definition at line 49 of file optional.h.

Member Function Documentation

◆ has_value()

template<typename T>
bool esphome::optional< T >::has_value ( ) const
inline

Definition at line 87 of file optional.h.

◆ operator safe_bool()

template<typename T>
esphome::optional< T >::operator safe_bool ( ) const
inline

Definition at line 85 of file optional.h.

◆ operator*() [1/2]

template<typename T>
value_type const& esphome::optional< T >::operator* ( ) const
inline

Definition at line 81 of file optional.h.

◆ operator*() [2/2]

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

Definition at line 83 of file optional.h.

◆ operator->() [1/2]

template<typename T>
value_type const* esphome::optional< T >::operator-> ( ) const
inline

Definition at line 77 of file optional.h.

◆ operator->() [2/2]

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

Definition at line 79 of file optional.h.

◆ operator=() [1/2]

template<typename T>
optional& esphome::optional< T >::operator= ( nullopt_t  )
inline

Definition at line 51 of file optional.h.

◆ operator=() [2/2]

template<typename T>
template<class U >
optional& esphome::optional< T >::operator= ( optional< U > const &  other)
inline

Definition at line 56 of file optional.h.

◆ reset()

template<typename T>
void esphome::optional< T >::reset ( )
inline

Definition at line 97 of file optional.h.

◆ swap()

template<typename T>
void esphome::optional< T >::swap ( optional< T > &  rhs)
inline

Definition at line 62 of file optional.h.

◆ value() [1/2]

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

Definition at line 89 of file optional.h.

◆ value() [2/2]

template<typename T>
value_type& esphome::optional< T >::value ( )
inline

Definition at line 91 of file optional.h.

◆ value_or()

template<typename T>
template<class U >
value_type esphome::optional< T >::value_or ( U const &  v) const
inline

Definition at line 93 of file optional.h.


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