AWS IoT Device SDK C++ v2: Aws::Crt::Optional< T > Class Template Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Public Member Functions | List of all members
Aws::Crt::Optional< T > Class Template Reference

`#include <Optional.h>`

## Public Member Functions
| Optional ()
| Optional (const T &val)
| Optional (T &&val)
| ~Optional ()
template<typename U = T>
Optional & | operator= (U &&u)
| Optional (const Optional< T > &other)
| Optional (Optional< T > &&other)
Optional & | operator= (const Optional &other)
template<typename U = T>
Optional< T > & | operator= (const Optional< U > &other)
template<typename U = T>
Optional< T > & | operator= (Optional< U > &&other)
const T * | operator-> () const
T * | operator-> ()
const T & | operator* () const &
T & | operator* () &
const T && | operator* () const &&
T && | operator* () &&
| operator bool () const noexcept
bool | has_value () const noexcept
T & | value () &
const T & | value () const &
T && | value () &&
const T && | value () const &&

## Detailed Description

template<typename T>
class Aws::Crt::Optional< T >

Custom implementation of an Option type. std::optional requires C++17

Template Parameters

  T | type of the optional value

## Constructor & Destructor Documentation

## ◆ Optional() [1/5]

template<typename T >

Aws::Crt::Optional< T >::Optional | ( |  | ) |
| inline

## ◆ Optional() [2/5]

template<typename T >

Aws::Crt::Optional< T >::Optional | ( | const T & | val | ) |
| inline

## ◆ Optional() [3/5]

template<typename T >

Aws::Crt::Optional< T >::Optional | ( | T && | val | ) |
| inline

## ◆ ~Optional()

template<typename T >

Aws::Crt::Optional< T >::~Optional | ( |  | ) |
| inline

## ◆ Optional() [4/5]

template<typename T >

Aws::Crt::Optional< T >::Optional | ( | const Optional< T > & | other | ) |
| inline

## ◆ Optional() [5/5]

template<typename T >

Aws::Crt::Optional< T >::Optional | ( | Optional< T > && | other | ) |
| inline

## Member Function Documentation

## ◆ has_value()

template<typename T >

bool Aws::Crt::Optional< T >::has_value | ( |  | ) | const
| inlinenoexcept

## ◆ operator bool()

template<typename T >

Aws::Crt::Optional< T >::operator bool | ( |  | ) | const
| inlineexplicitnoexcept

## ◆ operator*() [1/4]

template<typename T >

T & Aws::Crt::Optional< T >::operator* | ( |  | ) | &
| inline

## ◆ operator*() [2/4]

template<typename T >

T && Aws::Crt::Optional< T >::operator* | ( |  | ) | &&
| inline

## ◆ operator*() [3/4]

template<typename T >

const T & Aws::Crt::Optional< T >::operator* | ( |  | ) | const &
| inline

## ◆ operator*() [4/4]

template<typename T >

const T && Aws::Crt::Optional< T >::operator* | ( |  | ) | const &&
| inline

## ◆ operator->() [1/2]

template<typename T >

T * Aws::Crt::Optional< T >::operator-> | ( |  | ) |
| inline

## ◆ operator->() [2/2]

template<typename T >

const T * Aws::Crt::Optional< T >::operator-> | ( |  | ) | const
| inline

## ◆ operator=() [1/4]

template<typename T >

Optional & Aws::Crt::Optional< T >::operator= | ( | const Optional< T > & | other | ) |
| inline

## ◆ operator=() [2/4]

template<typename T >
template<typename U = T>

Optional< T > & Aws::Crt::Optional< T >::operator= | ( | const Optional< U > & | other | ) |
| inline

## ◆ operator=() [3/4]

template<typename T >
template<typename U = T>

Optional< T > & Aws::Crt::Optional< T >::operator= | ( | Optional< U > && | other | ) |
| inline

## ◆ operator=() [4/4]

template<typename T >
template<typename U = T>

Optional & Aws::Crt::Optional< T >::operator= | ( | U && | u | ) |
| inline

## ◆ value() [1/4]

template<typename T >

T & Aws::Crt::Optional< T >::value | ( |  | ) | &
| inline

## ◆ value() [2/4]

template<typename T >

T && Aws::Crt::Optional< T >::value | ( |  | ) | &&
| inline

## ◆ value() [3/4]

template<typename T >

const T & Aws::Crt::Optional< T >::value | ( |  | ) | const &
| inline

## ◆ value() [4/4]

template<typename T >

const T && Aws::Crt::Optional< T >::value | ( |  | ) | const &&
| inline

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

- crt/aws-crt-cpp/include/aws/crt/Optional.h