TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | List of all members
optional< T > Class Template Reference

Minimal header-only polyfill for std::optional for pre-C++17 environments. More...

#include <Optional.h>

Public Member Functions

 optional (nullopt_t) noexcept
 
 optional (const T &value)
 
 optional (T &&value)
 
 optional (const optional &other)
 
 optional (optional &&other) noexcept
 
optionaloperator= (nullopt_t) noexcept
 
optionaloperator= (const optional &other)
 
optionaloperator= (optional &&other) noexcept
 
bool has_value () const noexcept
 
 operator bool () const noexcept
 
T & value ()
 
const T & value () const
 
value_or (const T &default_value) const
 
void reset ()
 

Detailed Description

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

Minimal header-only polyfill for std::optional for pre-C++17 environments.

This implementation provides the basic interface of std::optional, allowing code to use std::optional<T> and std::nullopt in environments where the standard library version is not available.

Features:

Limitations:

Usage:


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