Skip to content

Commit 71a1324

Browse files
committed
Merge 2017-11 LWG Motion 8
2 parents 5624657 + adb3bdb commit 71a1324

File tree

10 files changed

+86
-83
lines changed

10 files changed

+86
-83
lines changed

source/basic.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,16 +3203,16 @@
32033203
program.
32043204

32053205
\begin{codeblock}
3206-
void* operator new(std::size_t);
3207-
void* operator new(std::size_t, std::align_val_t);
3206+
[[nodiscard]] void* operator new(std::size_t);
3207+
[[nodiscard]] void* operator new(std::size_t, std::align_val_t);
32083208

32093209
void operator delete(void*) noexcept;
32103210
void operator delete(void*, std::size_t) noexcept;
32113211
void operator delete(void*, std::align_val_t) noexcept;
32123212
void operator delete(void*, std::size_t, std::align_val_t) noexcept;
32133213

3214-
void* operator new[](std::size_t);
3215-
void* operator new[](std::size_t, std::align_val_t);
3214+
[[nodiscard]] void* operator new[](std::size_t);
3215+
[[nodiscard]] void* operator new[](std::size_t, std::align_val_t);
32163216

32173217
void operator delete[](void*) noexcept;
32183218
void operator delete[](void*, std::size_t) noexcept;

source/containers.tex

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@
12661266

12671267
allocator_type get_allocator() const;
12681268
explicit operator bool() const noexcept;
1269-
bool empty() const noexcept;
1269+
[[nodiscard]] bool empty() const noexcept;
12701270

12711271
void swap(@\placeholdernc{node_handle}@&)
12721272
noexcept(ator_traits::propagate_on_container_swap::value ||
@@ -1421,7 +1421,7 @@
14211421
\end{itemdescr}
14221422

14231423
\begin{itemdecl}
1424-
bool empty() const noexcept;
1424+
[[nodiscard]] bool empty() const noexcept;
14251425
\end{itemdecl}
14261426

14271427
\begin{itemdescr}
@@ -3191,7 +3191,7 @@
31913191
constexpr const_reverse_iterator crend() const noexcept;
31923192

31933193
// capacity
3194-
constexpr bool empty() const noexcept;
3194+
[[nodiscard]] constexpr bool empty() const noexcept;
31953195
constexpr size_type size() const noexcept;
31963196
constexpr size_type max_size() const noexcept;
31973197

@@ -3451,7 +3451,7 @@
34513451
const_reverse_iterator crend() const noexcept;
34523452

34533453
// \ref{deque.capacity}, capacity
3454-
bool empty() const noexcept;
3454+
[[nodiscard]] bool empty() const noexcept;
34553455
size_type size() const noexcept;
34563456
size_type max_size() const noexcept;
34573457
void resize(size_type sz);
@@ -3826,7 +3826,7 @@
38263826
const_iterator cend() const noexcept;
38273827

38283828
// capacity
3829-
bool empty() const noexcept;
3829+
[[nodiscard]] bool empty() const noexcept;
38303830
size_type max_size() const noexcept;
38313831

38323832
// \ref{forwardlist.access}, element access
@@ -4530,7 +4530,7 @@
45304530
const_reverse_iterator crend() const noexcept;
45314531

45324532
// \ref{list.capacity}, capacity
4533-
bool empty() const noexcept;
4533+
[[nodiscard]] bool empty() const noexcept;
45344534
size_type size() const noexcept;
45354535
size_type max_size() const noexcept;
45364536
void resize(size_type sz);
@@ -5209,7 +5209,7 @@
52095209
const_reverse_iterator crend() const noexcept;
52105210

52115211
// \ref{vector.capacity}, capacity
5212-
bool empty() const noexcept;
5212+
[[nodiscard]] bool empty() const noexcept;
52135213
size_type size() const noexcept;
52145214
size_type max_size() const noexcept;
52155215
size_type capacity() const noexcept;
@@ -5689,7 +5689,7 @@
56895689
const_reverse_iterator crend() const noexcept;
56905690

56915691
// capacity
5692-
bool empty() const noexcept;
5692+
[[nodiscard]] bool empty() const noexcept;
56935693
size_type size() const noexcept;
56945694
size_type max_size() const noexcept;
56955695
size_type capacity() const noexcept;
@@ -6086,7 +6086,7 @@
60866086
const_reverse_iterator crend() const noexcept;
60876087

60886088
// capacity
6089-
bool empty() const noexcept;
6089+
[[nodiscard]] bool empty() const noexcept;
60906090
size_type size() const noexcept;
60916091
size_type max_size() const noexcept;
60926092

@@ -6618,7 +6618,7 @@
66186618
const_reverse_iterator crend() const noexcept;
66196619

66206620
// capacity
6621-
bool empty() const noexcept;
6621+
[[nodiscard]] bool empty() const noexcept;
66226622
size_type size() const noexcept;
66236623
size_type max_size() const noexcept;
66246624

@@ -6914,7 +6914,7 @@
69146914
const_reverse_iterator crend() const noexcept;
69156915

69166916
// capacity
6917-
bool empty() const noexcept;
6917+
[[nodiscard]] bool empty() const noexcept;
69186918
size_type size() const noexcept;
69196919
size_type max_size() const noexcept;
69206920

@@ -7181,7 +7181,7 @@
71817181
const_reverse_iterator crend() const noexcept;
71827182

71837183
// capacity
7184-
bool empty() const noexcept;
7184+
[[nodiscard]] bool empty() const noexcept;
71857185
size_type size() const noexcept;
71867186
size_type max_size() const noexcept;
71877187

@@ -7594,7 +7594,7 @@
75947594
const_iterator cend() const noexcept;
75957595

75967596
// capacity
7597-
bool empty() const noexcept;
7597+
[[nodiscard]] bool empty() const noexcept;
75987598
size_type size() const noexcept;
75997599
size_type max_size() const noexcept;
76007600

@@ -8153,7 +8153,7 @@
81538153
const_iterator cend() const noexcept;
81548154

81558155
// capacity
8156-
bool empty() const noexcept;
8156+
[[nodiscard]] bool empty() const noexcept;
81578157
size_type size() const noexcept;
81588158
size_type max_size() const noexcept;
81598159

@@ -8496,7 +8496,7 @@
84968496
const_iterator cend() const noexcept;
84978497

84988498
// capacity
8499-
bool empty() const noexcept;
8499+
[[nodiscard]] bool empty() const noexcept;
85008500
size_type size() const noexcept;
85018501
size_type max_size() const noexcept;
85028502

@@ -8798,7 +8798,7 @@
87988798
const_iterator cend() const noexcept;
87998799

88008800
// capacity
8801-
bool empty() const noexcept;
8801+
[[nodiscard]] bool empty() const noexcept;
88028802
size_type size() const noexcept;
88038803
size_type max_size() const noexcept;
88048804

@@ -9122,7 +9122,7 @@
91229122
template <class Alloc> queue(const queue&, const Alloc&);
91239123
template <class Alloc> queue(queue&&, const Alloc&);
91249124

9125-
bool empty() const { return c.empty(); }
9125+
[[nodiscard]] bool empty() const { return c.empty(); }
91269126
size_type size() const { return c.size(); }
91279127
reference front() { return c.front(); }
91289128
const_reference front() const { return c.front(); }
@@ -9376,9 +9376,9 @@
93769376
template <class Alloc> priority_queue(const priority_queue&, const Alloc&);
93779377
template <class Alloc> priority_queue(priority_queue&&, const Alloc&);
93789378

9379-
bool empty() const { return c.empty(); }
9380-
size_type size() const { return c.size(); }
9381-
const_reference top() const { return c.front(); }
9379+
[[nodiscard]] bool empty() const { return c.empty(); }
9380+
size_type size() const { return c.size(); }
9381+
const_reference top() const { return c.front(); }
93829382
void push(const value_type& x);
93839383
void push(value_type&& x);
93849384
template <class... Args> void emplace(Args&&... args);
@@ -9665,7 +9665,7 @@
96659665
template <class Alloc> stack(const stack&, const Alloc&);
96669666
template <class Alloc> stack(stack&&, const Alloc&);
96679667

9668-
bool empty() const { return c.empty(); }
9668+
[[nodiscard]] bool empty() const { return c.empty(); }
96699669
size_type size() const { return c.size(); }
96709670
reference top() { return c.back(); }
96719671
const_reference top() const { return c.back(); }

source/iostreams.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10547,7 +10547,7 @@
1054710547
path extension() const;
1054810548

1054910549
// \ref{fs.path.query}, query
10550-
bool empty() const noexcept;
10550+
[[nodiscard]] bool empty() const noexcept;
1055110551
bool has_root_name() const;
1055210552
bool has_root_directory() const;
1055310553
bool has_root_path() const;
@@ -11710,7 +11710,7 @@
1171011710

1171111711
\indexlibrarymember{empty}{path}%
1171211712
\begin{itemdecl}
11713-
bool empty() const noexcept;
11713+
[[nodiscard]] bool empty() const noexcept;
1171411714
\end{itemdecl}
1171511715

1171611716
\begin{itemdescr}

source/iterators.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -850,9 +850,9 @@
850850
// \ref{iterator.container}, container access
851851
template <class C> constexpr auto size(const C& c) -> decltype(c.size());
852852
template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept;
853-
template <class C> constexpr auto empty(const C& c) -> decltype(c.empty());
854-
template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;
855-
template <class E> constexpr bool empty(initializer_list<E> il) noexcept;
853+
template <class C> [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty());
854+
template <class T, size_t N> [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept;
855+
template <class E> [[nodiscard]] constexpr bool empty(initializer_list<E> il) noexcept;
856856
template <class C> constexpr auto data(C& c) -> decltype(c.data());
857857
template <class C> constexpr auto data(const C& c) -> decltype(c.data());
858858
template <class T, size_t N> constexpr T* data(T (&array)[N]) noexcept;
@@ -3496,23 +3496,23 @@
34963496

34973497
\indexlibrary{\idxcode{empty(C\& c)}}%
34983498
\begin{itemdecl}
3499-
template <class C> constexpr auto empty(const C& c) -> decltype(c.empty());
3499+
template <class C> [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty());
35003500
\end{itemdecl}
35013501
\begin{itemdescr}
35023502
\pnum \returns \tcode{c.empty()}.
35033503
\end{itemdescr}
35043504

35053505
\indexlibrary{\idxcode{empty(T (\&array)[N])}}%
35063506
\begin{itemdecl}
3507-
template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;
3507+
template <class T, size_t N> [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept;
35083508
\end{itemdecl}
35093509
\begin{itemdescr}
35103510
\pnum \returns \tcode{false}.
35113511
\end{itemdescr}
35123512

35133513
\indexlibrary{\idxcode{empty(initializer_list<E>)}}%
35143514
\begin{itemdecl}
3515-
template <class E> constexpr bool empty(initializer_list<E> il) noexcept;
3515+
template <class E> [[nodiscard]] constexpr bool empty(initializer_list<E> il) noexcept;
35163516
\end{itemdecl}
35173517
\begin{itemdescr}
35183518
\pnum \returns \tcode{il.size() == 0}.

source/lib-intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,7 @@
21822182

21832183
template <class T> SimpleAllocator(const SimpleAllocator<T>& other);
21842184

2185-
Tp* allocate(std::size_t n);
2185+
[[nodiscard]] Tp* allocate(std::size_t n);
21862186
void deallocate(Tp* p, std::size_t n);
21872187
};
21882188

source/regex.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,7 +2528,7 @@
25282528
// \ref{re.results.size}, size
25292529
size_type size() const;
25302530
size_type max_size() const;
2531-
bool empty() const;
2531+
[[nodiscard]] bool empty() const;
25322532

25332533
// \ref{re.results.acc}, element access
25342534
difference_type length(size_type sub = 0) const;
@@ -2697,7 +2697,7 @@
26972697

26982698
\indexlibrarymember{match_results}{empty}%
26992699
\begin{itemdecl}
2700-
bool empty() const;
2700+
[[nodiscard]] bool empty() const;
27012701
\end{itemdecl}
27022702

27032703
\begin{itemdescr}

source/strings.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@
955955
void reserve(size_type res_arg = 0);
956956
void shrink_to_fit();
957957
void clear() noexcept;
958-
bool empty() const noexcept;
958+
[[nodiscard]] bool empty() const noexcept;
959959

960960
// \ref{string.access}, element access
961961
const_reference operator[](size_type pos) const;
@@ -1801,7 +1801,7 @@
18011801

18021802
\indexlibrarymember{empty}{basic_string}%
18031803
\begin{itemdecl}
1804-
bool empty() const noexcept;
1804+
[[nodiscard]] bool empty() const noexcept;
18051805
\end{itemdecl}
18061806

18071807
\begin{itemdescr}
@@ -4676,7 +4676,7 @@
46764676
constexpr size_type size() const noexcept;
46774677
constexpr size_type length() const noexcept;
46784678
constexpr size_type max_size() const noexcept;
4679-
constexpr bool empty() const noexcept;
4679+
[[nodiscard]] constexpr bool empty() const noexcept;
46804680

46814681
// \ref{string.view.access}, element access
46824682
constexpr const_reference operator[](size_type pos) const;
@@ -4916,7 +4916,7 @@
49164916

49174917
\indexlibrarymember{empty}{basic_string_view}%
49184918
\begin{itemdecl}
4919-
constexpr bool empty() const noexcept;
4919+
[[nodiscard]] constexpr bool empty() const noexcept;
49204920
\end{itemdecl}
49214921

49224922
\begin{itemdescr}

0 commit comments

Comments
 (0)