Skip to content

Commit 56ef003

Browse files
authored
Merge 2024-06 LWG Motion 11
P2422R1 Remove nodiscard annotations from the standard library specification
2 parents e12cbde + ad38306 commit 56ef003

12 files changed

+139
-146
lines changed

Diff for: source/basic.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -4025,16 +4025,16 @@
40254025
program.
40264026

40274027
\begin{codeblock}
4028-
[[nodiscard]] void* operator new(std::size_t);
4029-
[[nodiscard]] void* operator new(std::size_t, std::align_val_t);
4028+
void* operator new(std::size_t);
4029+
void* operator new(std::size_t, std::align_val_t);
40304030

40314031
void operator delete(void*) noexcept;
40324032
void operator delete(void*, std::size_t) noexcept;
40334033
void operator delete(void*, std::align_val_t) noexcept;
40344034
void operator delete(void*, std::size_t, std::align_val_t) noexcept;
40354035

4036-
[[nodiscard]] void* operator new[](std::size_t);
4037-
[[nodiscard]] void* operator new[](std::size_t, std::align_val_t);
4036+
void* operator new[](std::size_t);
4037+
void* operator new[](std::size_t, std::align_val_t);
40384038

40394039
void operator delete[](void*) noexcept;
40404040
void operator delete[](void*, std::size_t) noexcept;

Diff for: source/containers.tex

+25-25
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,7 @@
23172317

23182318
allocator_type get_allocator() const;
23192319
explicit operator bool() const noexcept;
2320-
[[nodiscard]] bool empty() const noexcept;
2320+
bool empty() const noexcept;
23212321

23222322
// \ref{container.node.modifiers}, modifiers
23232323
void swap(@\placeholdernc{node-handle}@&)
@@ -2495,7 +2495,7 @@
24952495
\end{itemdescr}
24962496

24972497
\begin{itemdecl}
2498-
[[nodiscard]] bool empty() const noexcept;
2498+
bool empty() const noexcept;
24992499
\end{itemdecl}
25002500

25012501
\begin{itemdescr}
@@ -6306,7 +6306,7 @@
63066306
constexpr const_reverse_iterator crend() const noexcept;
63076307

63086308
// capacity
6309-
[[nodiscard]] constexpr bool empty() const noexcept;
6309+
constexpr bool empty() const noexcept;
63106310
constexpr size_type size() const noexcept;
63116311
constexpr size_type max_size() const noexcept;
63126312

@@ -6629,7 +6629,7 @@
66296629
const_reverse_iterator crend() const noexcept;
66306630

66316631
// \ref{deque.capacity}, capacity
6632-
[[nodiscard]] bool empty() const noexcept;
6632+
bool empty() const noexcept;
66336633
size_type size() const noexcept;
66346634
size_type max_size() const noexcept;
66356635
void resize(size_type sz);
@@ -7088,7 +7088,7 @@
70887088
const_iterator cend() const noexcept;
70897089

70907090
// capacity
7091-
[[nodiscard]] bool empty() const noexcept;
7091+
bool empty() const noexcept;
70927092
size_type max_size() const noexcept;
70937093

70947094
// \ref{forward.list.access}, element access
@@ -7995,7 +7995,7 @@
79957995
const_reverse_iterator crend() const noexcept;
79967996

79977997
// \ref{list.capacity}, capacity
7998-
[[nodiscard]] bool empty() const noexcept;
7998+
bool empty() const noexcept;
79997999
size_type size() const noexcept;
80008000
size_type max_size() const noexcept;
80018001
void resize(size_type sz);
@@ -8740,7 +8740,7 @@
87408740
constexpr const_reverse_iterator crend() const noexcept;
87418741

87428742
// \ref{vector.capacity}, capacity
8743-
[[nodiscard]] constexpr bool empty() const noexcept;
8743+
constexpr bool empty() const noexcept;
87448744
constexpr size_type size() const noexcept;
87458745
constexpr size_type max_size() const noexcept;
87468746
constexpr size_type capacity() const noexcept;
@@ -9324,7 +9324,7 @@
93249324
constexpr const_reverse_iterator crend() const noexcept;
93259325

93269326
// capacity
9327-
[[nodiscard]] constexpr bool empty() const noexcept;
9327+
constexpr bool empty() const noexcept;
93289328
constexpr size_type size() const noexcept;
93299329
constexpr size_type max_size() const noexcept;
93309330
constexpr size_type capacity() const noexcept;
@@ -10439,7 +10439,7 @@
1043910439
const_reverse_iterator crend() const noexcept;
1044010440

1044110441
// capacity
10442-
[[nodiscard]] bool empty() const noexcept;
10442+
bool empty() const noexcept;
1044310443
size_type size() const noexcept;
1044410444
size_type max_size() const noexcept;
1044510445

@@ -11178,7 +11178,7 @@
1117811178
const_reverse_iterator crend() const noexcept;
1117911179

1118011180
// capacity
11181-
[[nodiscard]] bool empty() const noexcept;
11181+
bool empty() const noexcept;
1118211182
size_type size() const noexcept;
1118311183
size_type max_size() const noexcept;
1118411184

@@ -11518,7 +11518,7 @@
1151811518
const_reverse_iterator crend() const noexcept;
1151911519

1152011520
// capacity
11521-
[[nodiscard]] bool empty() const noexcept;
11521+
bool empty() const noexcept;
1152211522
size_type size() const noexcept;
1152311523
size_type max_size() const noexcept;
1152411524

@@ -11877,7 +11877,7 @@
1187711877
const_reverse_iterator crend() const noexcept;
1187811878

1187911879
// capacity
11880-
[[nodiscard]] bool empty() const noexcept;
11880+
bool empty() const noexcept;
1188111881
size_type size() const noexcept;
1188211882
size_type max_size() const noexcept;
1188311883

@@ -12364,7 +12364,7 @@
1236412364
const_iterator cend() const noexcept;
1236512365

1236612366
// capacity
12367-
[[nodiscard]] bool empty() const noexcept;
12367+
bool empty() const noexcept;
1236812368
size_type size() const noexcept;
1236912369
size_type max_size() const noexcept;
1237012370

@@ -13161,7 +13161,7 @@
1316113161
const_iterator cend() const noexcept;
1316213162

1316313163
// capacity
13164-
[[nodiscard]] bool empty() const noexcept;
13164+
bool empty() const noexcept;
1316513165
size_type size() const noexcept;
1316613166
size_type max_size() const noexcept;
1316713167

@@ -13583,7 +13583,7 @@
1358313583
const_iterator cend() const noexcept;
1358413584

1358513585
// capacity
13586-
[[nodiscard]] bool empty() const noexcept;
13586+
bool empty() const noexcept;
1358713587
size_type size() const noexcept;
1358813588
size_type max_size() const noexcept;
1358913589

@@ -14006,7 +14006,7 @@
1400614006
const_iterator cend() const noexcept;
1400714007

1400814008
// capacity
14009-
[[nodiscard]] bool empty() const noexcept;
14009+
bool empty() const noexcept;
1401014010
size_type size() const noexcept;
1401114011
size_type max_size() const noexcept;
1401214012

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

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

14965-
[[nodiscard]] bool empty() const { return c.empty(); }
14966-
size_type size() const { return c.size(); }
14967-
const_reference top() const { return c.front(); }
14965+
bool empty() const { return c.empty(); }
14966+
size_type size() const { return c.size(); }
14967+
const_reference top() const { return c.front(); }
1496814968
void push(const value_type& x);
1496914969
void push(value_type&& x);
1497014970
template<@\exposconcept{container-compatible-range}@<T> R>
@@ -15446,10 +15446,10 @@
1544615446
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
1544715447
stack(from_range_t, R&& rg, const Alloc&);
1544815448

15449-
[[nodiscard]] bool empty() const { return c.empty(); }
15450-
size_type size() const { return c.size(); }
15449+
bool empty() const { return c.empty(); }
15450+
size_type size() const { return c.size(); }
1545115451
reference top() { return c.back(); }
15452-
const_reference top() const { return c.back(); }
15452+
const_reference top() const { return c.back(); }
1545315453
void push(const value_type& x) { c.push_back(x); }
1545415454
void push(value_type&& x) { c.push_back(std::move(x)); }
1545515455
template<@\exposconcept{container-compatible-range}@<T> R>
@@ -19005,7 +19005,7 @@
1900519005
// \ref{span.obs}, observers
1900619006
constexpr size_type size() const noexcept;
1900719007
constexpr size_type size_bytes() const noexcept;
19008-
[[nodiscard]] constexpr bool empty() const noexcept;
19008+
constexpr bool empty() const noexcept;
1900919009

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

1950619506
\indexlibrarymember{span}{empty}%
1950719507
\begin{itemdecl}
19508-
[[nodiscard]] constexpr bool empty() const noexcept;
19508+
constexpr bool empty() const noexcept;
1950919509
\end{itemdecl}
1951019510

1951119511
\begin{itemdescr}

Diff for: source/diagnostics.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@
20092009
const_reverse_iterator crbegin() const noexcept;
20102010
const_reverse_iterator crend() const noexcept;
20112011

2012-
[[nodiscard]] bool empty() const noexcept;
2012+
bool empty() const noexcept;
20132013
size_type size() const noexcept;
20142014
size_type max_size() const noexcept;
20152015

@@ -2253,7 +2253,7 @@
22532253

22542254
\indexlibrarymember{empty}{basic_stacktrace}%
22552255
\begin{itemdecl}
2256-
[[nodiscard]] bool empty() const noexcept;
2256+
bool empty() const noexcept;
22572257
\end{itemdecl}
22582258

22592259
\begin{itemdescr}

Diff for: source/iostreams.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -13750,7 +13750,7 @@
1375013750
path extension() const;
1375113751

1375213752
// \ref{fs.path.query}, query
13753-
[[nodiscard]] bool empty() const noexcept;
13753+
bool empty() const noexcept;
1375413754
bool has_root_name() const;
1375513755
bool has_root_directory() const;
1375613756
bool has_root_path() const;
@@ -14996,7 +14996,7 @@
1499614996

1499714997
\indexlibrarymember{empty}{path}%
1499814998
\begin{itemdecl}
14999-
[[nodiscard]] bool empty() const noexcept;
14999+
bool empty() const noexcept;
1500015000
\end{itemdecl}
1500115001

1500215002
\begin{itemdescr}

Diff for: source/iterators.tex

+6-6
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,11 @@
503503
template<class T, ptrdiff_t N> constexpr ptrdiff_t
504504
ssize(const T (&array)[N]) noexcept; // freestanding
505505

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

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

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

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

74837483
\indexlibrary{\idxcode{empty(initializer_list<E>)}}%
74847484
\begin{itemdecl}
7485-
template<class E> [[nodiscard]] constexpr bool empty(initializer_list<E> il) noexcept;
7485+
template<class E> constexpr bool empty(initializer_list<E> il) noexcept;
74867486
\end{itemdecl}
74877487
\begin{itemdescr}
74887488
\pnum

0 commit comments

Comments
 (0)