Skip to content

[LWG motion 11 2024-06] P2422R1 Remove nodiscard annotations from the standard library specification #7110

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

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4025,16 +4025,16 @@
program.

\begin{codeblock}
[[nodiscard]] void* operator new(std::size_t);
[[nodiscard]] void* operator new(std::size_t, std::align_val_t);
void* operator new(std::size_t);
void* operator new(std::size_t, std::align_val_t);

void operator delete(void*) noexcept;
void operator delete(void*, std::size_t) noexcept;
void operator delete(void*, std::align_val_t) noexcept;
void operator delete(void*, std::size_t, std::align_val_t) noexcept;

[[nodiscard]] void* operator new[](std::size_t);
[[nodiscard]] void* operator new[](std::size_t, std::align_val_t);
void* operator new[](std::size_t);
void* operator new[](std::size_t, std::align_val_t);

void operator delete[](void*) noexcept;
void operator delete[](void*, std::size_t) noexcept;
Expand Down
50 changes: 25 additions & 25 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2317,7 +2317,7 @@

allocator_type get_allocator() const;
explicit operator bool() const noexcept;
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;

// \ref{container.node.modifiers}, modifiers
void swap(@\placeholdernc{node-handle}@&)
Expand Down Expand Up @@ -2495,7 +2495,7 @@
\end{itemdescr}

\begin{itemdecl}
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -6306,7 +6306,7 @@
constexpr const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;

Expand Down Expand Up @@ -6629,7 +6629,7 @@
const_reverse_iterator crend() const noexcept;

// \ref{deque.capacity}, capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;
void resize(size_type sz);
Expand Down Expand Up @@ -7088,7 +7088,7 @@
const_iterator cend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type max_size() const noexcept;

// \ref{forward.list.access}, element access
Expand Down Expand Up @@ -7995,7 +7995,7 @@
const_reverse_iterator crend() const noexcept;

// \ref{list.capacity}, capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;
void resize(size_type sz);
Expand Down Expand Up @@ -8740,7 +8740,7 @@
constexpr const_reverse_iterator crend() const noexcept;

// \ref{vector.capacity}, capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
constexpr size_type capacity() const noexcept;
Expand Down Expand Up @@ -9324,7 +9324,7 @@
constexpr const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
constexpr size_type capacity() const noexcept;
Expand Down Expand Up @@ -10439,7 +10439,7 @@
const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -11178,7 +11178,7 @@
const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -11518,7 +11518,7 @@
const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -11877,7 +11877,7 @@
const_reverse_iterator crend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -12364,7 +12364,7 @@
const_iterator cend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -13161,7 +13161,7 @@
const_iterator cend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -13583,7 +13583,7 @@
const_iterator cend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -14006,7 +14006,7 @@
const_iterator cend() const noexcept;

// capacity
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -14578,7 +14578,7 @@
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
queue(from_range_t, R&& rg, const Alloc&);

[[nodiscard]] bool empty() const { return c.empty(); }
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
reference front() { return c.front(); }
const_reference front() const { return c.front(); }
Expand Down Expand Up @@ -14962,9 +14962,9 @@
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
priority_queue(from_range_t, R&& rg, const Alloc&);

[[nodiscard]] bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
const_reference top() const { return c.front(); }
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
const_reference top() const { return c.front(); }
void push(const value_type& x);
void push(value_type&& x);
template<@\exposconcept{container-compatible-range}@<T> R>
Expand Down Expand Up @@ -15446,10 +15446,10 @@
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
stack(from_range_t, R&& rg, const Alloc&);

[[nodiscard]] bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
reference top() { return c.back(); }
const_reference top() const { return c.back(); }
const_reference top() const { return c.back(); }
void push(const value_type& x) { c.push_back(x); }
void push(value_type&& x) { c.push_back(std::move(x)); }
template<@\exposconcept{container-compatible-range}@<T> R>
Expand Down Expand Up @@ -19005,7 +19005,7 @@
// \ref{span.obs}, observers
constexpr size_type size() const noexcept;
constexpr size_type size_bytes() const noexcept;
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr bool empty() const noexcept;

// \ref{span.elem}, element access
constexpr reference operator[](size_type idx) const;
Expand Down Expand Up @@ -19505,7 +19505,7 @@

\indexlibrarymember{span}{empty}%
\begin{itemdecl}
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr bool empty() const noexcept;
\end{itemdecl}

\begin{itemdescr}
Expand Down
4 changes: 2 additions & 2 deletions source/diagnostics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@
const_reverse_iterator crbegin() const noexcept;
const_reverse_iterator crend() const noexcept;

[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;

Expand Down Expand Up @@ -2253,7 +2253,7 @@

\indexlibrarymember{empty}{basic_stacktrace}%
\begin{itemdecl}
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
\end{itemdecl}

\begin{itemdescr}
Expand Down
4 changes: 2 additions & 2 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13750,7 +13750,7 @@
path extension() const;

// \ref{fs.path.query}, query
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
bool has_root_name() const;
bool has_root_directory() const;
bool has_root_path() const;
Expand Down Expand Up @@ -14996,7 +14996,7 @@

\indexlibrarymember{empty}{path}%
\begin{itemdecl}
[[nodiscard]] bool empty() const noexcept;
bool empty() const noexcept;
\end{itemdecl}

\begin{itemdescr}
Expand Down
12 changes: 6 additions & 6 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,11 @@
template<class T, ptrdiff_t N> constexpr ptrdiff_t
ssize(const T (&array)[N]) noexcept; // freestanding

template<class C> [[nodiscard]] constexpr auto
template<class C> constexpr auto
empty(const C& c) -> decltype(c.empty()); // freestanding
template<class T, size_t N> [[nodiscard]] constexpr bool
template<class T, size_t N> constexpr bool
empty(const T (&array)[N]) noexcept; // freestanding
template<class E> [[nodiscard]] constexpr bool
template<class E> constexpr bool
empty(initializer_list<E> il) noexcept; // freestanding

template<class C> constexpr auto data(C& c) -> decltype(c.data()); // freestanding
Expand Down Expand Up @@ -7462,7 +7462,7 @@

\indexlibrary{\idxcode{empty(C\& c)}}%
\begin{itemdecl}
template<class C> [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty());
template<class C> constexpr auto empty(const C& c) -> decltype(c.empty());
\end{itemdecl}
\begin{itemdescr}
\pnum
Expand All @@ -7472,7 +7472,7 @@

\indexlibrary{\idxcode{empty(T (\&array)[N])}}%
\begin{itemdecl}
template<class T, size_t N> [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept;
template<class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;
\end{itemdecl}
\begin{itemdescr}
\pnum
Expand All @@ -7482,7 +7482,7 @@

\indexlibrary{\idxcode{empty(initializer_list<E>)}}%
\begin{itemdecl}
template<class E> [[nodiscard]] constexpr bool empty(initializer_list<E> il) noexcept;
template<class E> constexpr bool empty(initializer_list<E> il) noexcept;
\end{itemdecl}
\begin{itemdescr}
\pnum
Expand Down
Loading
Loading