Skip to content

[optional.optional.ref.general] Fix indentation #8104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 61 additions & 61 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4451,68 +4451,68 @@
namespace std {
template<class T>
class optional<T&> {
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<class Arg>
constexpr explicit optional(in_place_t, Arg&& arg);
template<class U>
constexpr explicit(@\seebelow@) optional(U&& u) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(optional<U>& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(const optional<U>& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(optional<U>&& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(const optional<U>&& 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<class U> 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<class U = remove_cv_t<T>>
constexpr remove_cv_t<T> value_or(U&& u) const;

// \ref{optional.ref.monadic}, monadic operations
template<class F> constexpr auto and_then(F&& f) const;
template<class F> constexpr optional<invoke_result_t<F, T&>> transform(F&& f) const;
template<class F> 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<class U>
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<class Arg>
constexpr explicit optional(in_place_t, Arg&& arg);
template<class U>
constexpr explicit(@\seebelow@) optional(U&& u) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(optional<U>& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(const optional<U>& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(optional<U>&& rhs) noexcept(@\seebelow@);
template<class U>
constexpr explicit(@\seebelow@) optional(const optional<U>&& 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<class U> 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<class U = remove_cv_t<T>>
constexpr remove_cv_t<T> value_or(U&& u) const;

// \ref{optional.ref.monadic}, monadic operations
template<class F> constexpr auto and_then(F&& f) const;
template<class F> constexpr optional<invoke_result_t<F, T&>> transform(F&& f) const;
template<class F> 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<class U>
constexpr void @\exposidnc{convert-ref-init-val}@(U&& u); // \expos
};
}
\end{codeblock}

Expand Down