NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::optional< T > Class Template Reference

#include <backports-optional.hpp>

Inheritance diagram for ndn::optional< T >:

Public Types

typedef T value_type
 

Public Member Functions

constexpr optional () noexcept
 
constexpr optional (nullopt_t) noexcept
 
constexpr optional (const T &value)
 
template<typename... Args>
constexpr optional (in_place_t, Args &&... args)
 
optionaloperator= (nullopt_t) noexcept
 
optionaloperator= (const optional &other)
 
template<typename U , typename = typename std::enable_if<std::is_same<typename std::decay<U>::type, T>::value>::type>
optionaloperator= (U &&value)
 
constexpr const T * operator-> () const
 
T * operator-> ()
 
constexpr const T & operator* () const
 
T & operator* ()
 
constexpr operator bool () const noexcept
 
const T & value () const
 
T & value ()
 
template<typename U >
constexpr T value_or (U &&default_value) const
 
void swap (optional &other)
 
void reset () noexcept
 
template<typename... Args>
void emplace (Args &&... args)
 

Friends

bool operator== (const optional< T > &, const optional< T > &)
 
bool operator!= (const optional< T > &, const optional< T > &)
 
bool operator (const optional< T > &, const optional< T > &)
 
bool operator (const optional< T > &, const optional< T > &)
 
bool operator> (const optional< T > &, const optional< T > &)
 
bool operator>= (const optional< T > &, const optional< T > &)
 

Detailed Description

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

Definition at line 93 of file backports-optional.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 154 of file backports-optional.hpp.

Constructor & Destructor Documentation

◆ optional() [1/4]

template<typename T>
constexpr ndn::optional< T >::optional ( )
inlinenoexcept

Definition at line 159 of file backports-optional.hpp.

◆ optional() [2/4]

template<typename T>
constexpr ndn::optional< T >::optional ( nullopt_t  )
inlinenoexcept

Definition at line 164 of file backports-optional.hpp.

◆ optional() [3/4]

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

Definition at line 169 of file backports-optional.hpp.

◆ optional() [4/4]

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

Definition at line 176 of file backports-optional.hpp.

Member Function Documentation

◆ operator=() [1/3]

template<typename T>
optional& ndn::optional< T >::operator= ( nullopt_t  )
inlinenoexcept

Definition at line 182 of file backports-optional.hpp.

◆ operator=() [2/3]

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

Definition at line 189 of file backports-optional.hpp.

◆ operator=() [3/3]

template<typename T>
template<typename U , typename = typename std::enable_if<std::is_same<typename std::decay<U>::type, T>::value>::type>
optional& ndn::optional< T >::operator= ( U &&  value)
inline

Definition at line 198 of file backports-optional.hpp.

◆ operator->() [1/2]

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

Definition at line 206 of file backports-optional.hpp.

◆ operator->() [2/2]

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

Definition at line 212 of file backports-optional.hpp.

◆ operator*() [1/2]

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

Definition at line 218 of file backports-optional.hpp.

◆ operator*() [2/2]

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

Definition at line 224 of file backports-optional.hpp.

◆ operator bool()

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

Definition at line 230 of file backports-optional.hpp.

◆ value() [1/2]

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

◆ value() [2/2]

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

Definition at line 242 of file backports-optional.hpp.

◆ value_or()

template<typename T>
template<typename U >
constexpr T ndn::optional< T >::value_or ( U &&  default_value) const
inline

Definition at line 256 of file backports-optional.hpp.

◆ swap()

template<typename T>
void ndn::optional< T >::swap ( optional< T > &  other)
inline

Definition at line 267 of file backports-optional.hpp.

◆ reset()

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

Definition at line 273 of file backports-optional.hpp.

◆ emplace()

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

Friends And Related Function Documentation

◆ operator==

template<typename T>
bool operator== ( const optional< T > &  lhs,
const optional< T > &  rhs 
)
friend

Definition at line 298 of file backports-optional.hpp.

◆ operator!=

template<typename T>
bool operator!= ( const optional< T > &  lhs,
const optional< T > &  rhs 
)
friend

Definition at line 305 of file backports-optional.hpp.

◆ operator [1/2]

template<typename T>
bool operator ( const optional< T > &  ,
const optional< T > &   
)
friend

◆ operator [2/2]

template<typename T>
bool operator ( const optional< T > &  ,
const optional< T > &   
)
friend

◆ operator>

template<typename T>
bool operator> ( const optional< T > &  lhs,
const optional< T > &  rhs 
)
friend

Definition at line 326 of file backports-optional.hpp.

◆ operator>=

template<typename T>
bool operator>= ( const optional< T > &  lhs,
const optional< T > &  rhs 
)
friend

Definition at line 333 of file backports-optional.hpp.


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