diff --git a/source/utilities.tex b/source/utilities.tex index 0a26e0266a..f864a3766c 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4451,68 +4451,68 @@ namespace std { template class optional { - public: - using value_type = T; - using iterator = @\impdefnc@; // see~\ref{optional.ref.iterators} + public: + using value_type = T; + using iterator = @\impdefnc@; // see~\ref{optional.ref.iterators} - public: - // \ref{optional.ref.ctor}, constructors - constexpr optional() noexcept = default; - constexpr optional(nullopt_t) noexcept : optional() {} - constexpr optional(const optional& rhs) noexcept = default; - - template - constexpr explicit optional(in_place_t, Arg&& arg); - template - constexpr explicit(@\seebelow@) optional(U&& u) noexcept(@\seebelow@); - template - constexpr explicit(@\seebelow@) optional(optional& rhs) noexcept(@\seebelow@); - template - constexpr explicit(@\seebelow@) optional(const optional& rhs) noexcept(@\seebelow@); - template - constexpr explicit(@\seebelow@) optional(optional&& rhs) noexcept(@\seebelow@); - template - constexpr explicit(@\seebelow@) optional(const optional&& rhs) noexcept(@\seebelow@); - - constexpr ~optional() = default; - - // \ref{optional.ref.assign}, assignment - constexpr optional& operator=(nullopt_t) noexcept; - constexpr optional& operator=(const optional& rhs) noexcept = default; - - template constexpr T& emplace(U&& u) noexcept(@\seebelow@); - - // \ref{optional.ref.swap}, swap - constexpr void swap(optional& rhs) noexcept; - - // \ref{optional.iterators}, iterator support - constexpr iterator begin() const noexcept; - constexpr iterator end() const noexcept; - - // \ref{optional.ref.observe}, observers - constexpr T* operator->() const noexcept; - constexpr T& operator*() const noexcept; - constexpr explicit operator bool() const noexcept; - constexpr bool has_value() const noexcept; - constexpr T& value() const; // freestanding-deleted - template> - constexpr remove_cv_t value_or(U&& u) const; - - // \ref{optional.ref.monadic}, monadic operations - template constexpr auto and_then(F&& f) const; - template constexpr optional> transform(F&& f) const; - template constexpr optional or_else(F&& f) const; - - // \ref{optional.ref.mod}, modifiers - constexpr void reset() noexcept; - - private: - T* @\exposidnc{val}@ = nullptr; // \expos - - // \ref{optional.ref.expos}, exposition only helper functions - template - constexpr void @\exposidnc{convert-ref-init-val}@(U&& u); // \expos - }; + public: + // \ref{optional.ref.ctor}, constructors + constexpr optional() noexcept = default; + constexpr optional(nullopt_t) noexcept : optional() {} + constexpr optional(const optional& rhs) noexcept = default; + + template + constexpr explicit optional(in_place_t, Arg&& arg); + template + constexpr explicit(@\seebelow@) optional(U&& u) noexcept(@\seebelow@); + template + constexpr explicit(@\seebelow@) optional(optional& rhs) noexcept(@\seebelow@); + template + constexpr explicit(@\seebelow@) optional(const optional& rhs) noexcept(@\seebelow@); + template + constexpr explicit(@\seebelow@) optional(optional&& rhs) noexcept(@\seebelow@); + template + constexpr explicit(@\seebelow@) optional(const optional&& rhs) noexcept(@\seebelow@); + + constexpr ~optional() = default; + + // \ref{optional.ref.assign}, assignment + constexpr optional& operator=(nullopt_t) noexcept; + constexpr optional& operator=(const optional& rhs) noexcept = default; + + template constexpr T& emplace(U&& u) noexcept(@\seebelow@); + + // \ref{optional.ref.swap}, swap + constexpr void swap(optional& rhs) noexcept; + + // \ref{optional.iterators}, iterator support + constexpr iterator begin() const noexcept; + constexpr iterator end() const noexcept; + + // \ref{optional.ref.observe}, observers + constexpr T* operator->() const noexcept; + constexpr T& operator*() const noexcept; + constexpr explicit operator bool() const noexcept; + constexpr bool has_value() const noexcept; + constexpr T& value() const; // freestanding-deleted + template> + constexpr remove_cv_t value_or(U&& u) const; + + // \ref{optional.ref.monadic}, monadic operations + template constexpr auto and_then(F&& f) const; + template constexpr optional> transform(F&& f) const; + template constexpr optional or_else(F&& f) const; + + // \ref{optional.ref.mod}, modifiers + constexpr void reset() noexcept; + + private: + T* @\exposidnc{val}@ = nullptr; // \expos + + // \ref{optional.ref.expos}, exposition only helper functions + template + constexpr void @\exposidnc{convert-ref-init-val}@(U&& u); // \expos + }; } \end{codeblock}