cpp17::optional

Summary

Inheritance

Inherits from: cpp17::internal::modulate_copy_and_move< T >

Constructors and Destructors

optional()
optional(nullopt_t)
optional(const optional &)
optional(optional &&)
optional(U && value)
optional(U && value)
optional(const optional< U > & other)
optional(const optional< U > & other)
optional(optional< U > && other)
optional(optional< U > && other)
optional(in_place_t, Args &&... args)
optional(in_place_t, std::initializer_list< U > init_list, Args &&... args)
~optional()

Public types

value_type using
T

Public functions

emplace(Args &&... args)
constexpr emplace_constructible< Args &&...>
emplace(std::initializer_list< U > init_list, Args &&... args)
constexpr emplace_constructible< std::initializer_list< U > &, Args &&...>
has_value() const
constexpr bool
operator bool() const
constexpr
operator*()
constexpr T &
operator*() const
constexpr const T &
operator->()
constexpr T *
operator->() const
constexpr const T *
operator=(const optional &)=default
constexpr optional &
operator=(optional &&)=default
constexpr optional &
operator=(U && value)
constexpr assignment_requires_conditions< not_self_type< U >, negation< conjunction< std::is_scalar< T >, std::is_same< T, std::decay_t< U > > > >, std::is_constructible< T, U >, std::is_assignable< T &, U > >
operator=(const optional< U > & other)
constexpr assignment_requires_conditions< negation< std::is_same< T, U > >, std::is_constructible< T, const U & >, std::is_assignable< T &, U >, negation< converts_from_optional< T, U > >, negation< assigns_from_optional< T, U > > >
operator=(optional< U > && other)
constexpr assignment_requires_conditions< negation< std::is_same< T, U > >, std::is_constructible< T, U >, std::is_assignable< T &, U >, negation< converts_from_optional< T, U > >, negation< assigns_from_optional< T, U > > >
operator=(nullopt_t)
constexpr optional &
reset() noexcept
void
swap(optional & other)
constexpr void
value()&
constexpr T &
value() const &
constexpr const T &
value()&&
constexpr T &&
value() const &&
constexpr const T &&
value_or(U && default_value) const &
constexpr T
value_or(U && default_value)&&
constexpr T

Public types

value_type

T value_type

Public functions

emplace

constexpr emplace_constructible< Args &&...> emplace(
  Args &&... args
)

emplace

constexpr emplace_constructible< std::initializer_list< U > &, Args &&...> emplace(
  std::initializer_list< U > init_list,
  Args &&... args
)

has_value

constexpr bool has_value() const 

operator bool

constexpr operator bool() const 

operator*

constexpr T & operator*()

operator*

constexpr const T & operator*() const 

operator->

constexpr T * operator->()

operator->

constexpr const T * operator->() const 

operator=

constexpr optional & operator=(
  const optional &
)=default

operator=

constexpr optional & operator=(
  optional &&
)=default

operator=

constexpr assignment_requires_conditions< not_self_type< U >, negation< conjunction< std::is_scalar< T >, std::is_same< T, std::decay_t< U > > > >, std::is_constructible< T, U >, std::is_assignable< T &, U > > operator=(
  U && value
)

operator=

constexpr assignment_requires_conditions< negation< std::is_same< T, U > >, std::is_constructible< T, const U & >, std::is_assignable< T &, U >, negation< converts_from_optional< T, U > >, negation< assigns_from_optional< T, U > > > operator=(
  const optional< U > & other
)

operator=

constexpr assignment_requires_conditions< negation< std::is_same< T, U > >, std::is_constructible< T, U >, std::is_assignable< T &, U >, negation< converts_from_optional< T, U > >, negation< assigns_from_optional< T, U > > > operator=(
  optional< U > && other
)

operator=

constexpr optional & operator=(
  nullopt_t
)

optional

constexpr optional()=default

optional

constexpr optional(
  nullopt_t
) noexcept

optional

constexpr optional(
  const optional &
)=default

optional

constexpr optional(
  optional &&
)=default

optional

constexpr optional(
  U && value
)

optional

constexpr optional(
  U && value
)

optional

constexpr optional(
  const optional< U > & other
)

optional

constexpr optional(
  const optional< U > & other
)

optional

constexpr optional(
  optional< U > && other
)

optional

constexpr optional(
  optional< U > && other
)

optional

constexpr optional(
  in_place_t,
  Args &&... args
)

optional

constexpr optional(
  in_place_t,
  std::initializer_list< U > init_list,
  Args &&... args
)

reset

void reset() noexcept

swap

constexpr void swap(
  optional & other
)

value

constexpr T & value()&

value

constexpr const T & value() const &

value

constexpr T && value()&&

value

constexpr const T && value() const &&

value_or

constexpr T value_or(
  U && default_value
) const &

value_or

constexpr T value_or(
  U && default_value
)&&

~optional

 ~optional()=default