tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
optional< T & > Struct Template Reference

#include <optional.hpp>

Public Types

using value_type = T &
 

Public Member Functions

constexpr optional () noexcept=default
 
constexpr optional (nullopt_t) noexcept
 
constexpr optional (optional &&other) noexcept=default
 
constexpr optional (optional const &other)=default
 
constexpr ~optional ()=default
 
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr auto emplace (U &&u) noexcept -> optional &
 
template<typename U >
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr explicit (not is_convertible_v< U, T >) optional(optional< U > const &rhs)
 
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr explicit (not is_convertible_v< U, T >) optional(U &&v)
 
constexpr auto has_value () const noexcept -> bool
 
constexpr operator bool () const noexcept
 
constexpr auto operator* () const noexcept -> T &
 
constexpr auto operator-> () const noexcept -> T *
 
constexpr auto operator= (nullopt_t) noexcept -> optional &
 
constexpr auto operator= (optional &&) noexcept -> optional &=default
 
constexpr auto operator= (optional const &) noexcept -> optional &=default
 
template<typename U >
constexpr auto operator= (optional< U > const &rhs) -> optional &
 
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional> and not conjunction_v<is_scalar<T>, is_same<T, decay_t<U>>>)
constexpr auto operator= (U &&v) -> optional &
 
constexpr void reset () noexcept
 
constexpr void swap (optional &rhs) noexcept
 

Member Typedef Documentation

◆ value_type

template<typename T >
using value_type = T&

Constructor & Destructor Documentation

◆ optional() [1/4]

template<typename T >
constexpr optional ( )
constexprdefaultnoexcept

◆ optional() [2/4]

template<typename T >
constexpr optional ( nullopt_t  )
inlineconstexprnoexcept

◆ optional() [3/4]

template<typename T >
constexpr optional ( optional< T & > const other)
constexprdefault

◆ optional() [4/4]

template<typename T >
constexpr optional ( optional< T & > &&  other)
constexprdefaultnoexcept

◆ ~optional()

template<typename T >
constexpr ~optional ( )
constexprdefault

Member Function Documentation

◆ emplace()

template<typename T >
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr auto emplace ( U &&  u) -> optional&
inlineconstexprnoexcept

◆ explicit() [1/2]

template<typename T >
template<typename U >
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr explicit ( not is_convertible_v< U, T ) const &
inlineconstexpr

◆ explicit() [2/2]

template<typename T >
template<typename U = T>
requires (not is_same_v<remove_cvref_t<U>, optional>)
constexpr explicit ( not is_convertible_v< U, T ) &&
inlineconstexpr

◆ has_value()

template<typename T >
constexpr auto has_value ( ) const -> bool
inlineconstexprnoexcept

◆ operator bool()

template<typename T >
constexpr operator bool ( ) const
inlineexplicitconstexprnoexcept

◆ operator*()

template<typename T >
constexpr auto operator* ( ) const -> T&
inlineconstexprnoexcept

◆ operator->()

template<typename T >
constexpr auto operator-> ( ) const -> T*
inlineconstexprnoexcept

◆ operator=() [1/5]

template<typename T >
constexpr auto operator= ( nullopt_t  ) -> optional&
inlineconstexprnoexcept

◆ operator=() [2/5]

template<typename T >
constexpr auto operator= ( optional< T & > &&  ) -> optional &=default
constexprdefaultnoexcept

◆ operator=() [3/5]

template<typename T >
constexpr auto operator= ( optional< T & > const ) -> optional &=default
constexprdefaultnoexcept

◆ operator=() [4/5]

template<typename T >
template<typename U >
constexpr auto operator= ( optional< U > const rhs) -> optional&
inlineconstexpr

◆ operator=() [5/5]

template<typename T >
constexpr auto operator= ( U &&  v) -> optional&
inlineconstexpr

◆ reset()

template<typename T >
constexpr void reset ( )
inlineconstexprnoexcept

◆ swap()

template<typename T >
constexpr void swap ( optional< T & > &  rhs)
inlineconstexprnoexcept

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