Skip to content

Commit fae1bc5

Browse files
committed
remove second constexpr if
Fixes NB US 113-173 (C++26 CD).
2 parents 11c4755 + cd23bd1 commit fae1bc5

File tree

7 files changed

+52
-36
lines changed

7 files changed

+52
-36
lines changed

source/compatibility.tex

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,10 +2996,7 @@
29962996
\end{example}
29972997

29982998
\howwide
2999-
This is fairly widely used but it is good
3000-
programming practice to add the cast when assigning pointer-to-void to pointer-to-object.
3001-
Some C translators will give a warning
3002-
if the cast is not used.
2999+
Common.
30033000

30043001
\diffref{expr.arith.conv}
30053002
\change

source/containers.tex

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6444,8 +6444,8 @@
64446444
template<class T, class Allocator>
64456445
constexpr bool operator==(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
64466446
template<class T, class Allocator>
6447-
constexpr @\placeholder{synth-three-way-result}@<T> operator<=>(const deque<T, Allocator>& x,
6448-
@\itcorr@ const deque<T, Allocator>& y);
6447+
constexpr @\placeholder{synth-three-way-result}@<T>
6448+
operator<=>(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
64496449

64506450
template<class T, class Allocator>
64516451
constexpr void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
@@ -6940,8 +6940,9 @@
69406940
constexpr bool operator==(const forward_list<T, Allocator>& x,
69416941
const forward_list<T, Allocator>& y);
69426942
template<class T, class Allocator>
6943-
constexpr @\placeholder{synth-three-way-result}@<T> operator<=>(const forward_list<T, Allocator>& x,
6944-
@\itcorr@ const forward_list<T, Allocator>& y);
6943+
constexpr @\placeholder{synth-three-way-result}@<T>
6944+
operator<=>(const forward_list<T, Allocator>& x,
6945+
const forward_list<T, Allocator>& y);
69456946

69466947
template<class T, class Allocator>
69476948
constexpr void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
@@ -8994,8 +8995,8 @@
89948995
template<class T, class Allocator>
89958996
constexpr bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
89968997
template<class T, class Allocator>
8997-
constexpr @\placeholder{synth-three-way-result}@<T> operator<=>(const list<T, Allocator>& x,
8998-
@\itcorr@ const list<T, Allocator>& y);
8998+
constexpr @\placeholder{synth-three-way-result}@<T>
8999+
operator<=>(const list<T, Allocator>& x, const list<T, Allocator>& y);
89999000

90009001
template<class T, class Allocator>
90019002
constexpr void swap(list<T, Allocator>& x, list<T, Allocator>& y)
@@ -9787,8 +9788,8 @@
97879788
template<class T, class Allocator>
97889789
constexpr bool operator==(const vector<T, Allocator>& x, const vector<T, Allocator>& y);
97899790
template<class T, class Allocator>
9790-
constexpr @\placeholder{synth-three-way-result}@<T> operator<=>(const vector<T, Allocator>& x,
9791-
@\itcorr@ const vector<T, Allocator>& y);
9791+
constexpr @\placeholder{synth-three-way-result}@<T>
9792+
operator<=>(const vector<T, Allocator>& x, const vector<T, Allocator>& y);
97929793

97939794
template<class T, class Allocator>
97949795
constexpr void swap(vector<T, Allocator>& x, vector<T, Allocator>& y)
@@ -10575,7 +10576,7 @@
1057510576

1057610577
\pnum
1057710578
Unless described below, all operations have the same requirements and
10578-
semantics as the primary \tcode{vector} template, except that operations
10579+
semantics as the \tcode{vector} primary template, except that operations
1057910580
dealing with the \tcode{bool} value type map to bit values in the
1058010581
container storage and
1058110582
\tcode{allocator_traits::construct}\iref{allocator.traits.members}
@@ -12585,8 +12586,9 @@
1258512586
constexpr bool operator==(const set<Key, Compare, Allocator>& x,
1258612587
const set<Key, Compare, Allocator>& y);
1258712588
template<class Key, class Compare, class Allocator>
12588-
constexpr @\placeholder{synth-three-way-result}@<Key> operator<=>(const set<Key, Compare, Allocator>& x,
12589-
@\itcorr@ const set<Key, Compare, Allocator>& y);
12589+
constexpr @\placeholder{synth-three-way-result}@<Key>
12590+
operator<=>(const set<Key, Compare, Allocator>& x,
12591+
const set<Key, Compare, Allocator>& y);
1259012592

1259112593
template<class Key, class Compare, class Allocator>
1259212594
constexpr void swap(set<Key, Compare, Allocator>& x,
@@ -13489,8 +13491,8 @@
1348913491

1349013492
template<@\exposconcept{container-compatible-range}@<value_type> R>
1349113493
constexpr unordered_map(from_range_t, R&& rg, size_type n = @\seebelow@,
13492-
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
13493-
const allocator_type& a = allocator_type());
13494+
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
13495+
const allocator_type& a = allocator_type());
1349413496
constexpr unordered_map(const unordered_map&);
1349513497
constexpr unordered_map(unordered_map&&);
1349613498
constexpr explicit unordered_map(const Allocator&);
@@ -13510,7 +13512,7 @@
1351013512
: unordered_map(f, l, n, hasher(), key_equal(), a) { }
1351113513
template<class InputIterator>
1351213514
constexpr unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,
13513-
const allocator_type& a)
13515+
const allocator_type& a)
1351413516
: unordered_map(f, l, n, hf, key_equal(), a) { }
1351513517
template<@\exposconcept{container-compatible-range}@<value_type> R>
1351613518
constexpr unordered_map(from_range_t, R&& rg, size_type n, const allocator_type& a)
@@ -13523,7 +13525,7 @@
1352313525
const allocator_type& a)
1352413526
: unordered_map(il, n, hasher(), key_equal(), a) { }
1352513527
constexpr unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf,
13526-
const allocator_type& a)
13528+
const allocator_type& a)
1352713529
: unordered_map(il, n, hf, key_equal(), a) { }
1352813530
constexpr ~unordered_map();
1352913531
constexpr unordered_map& operator=(const unordered_map&);

source/iostreams.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14727,7 +14727,7 @@
1472714727
\begin{itemdescr}
1472814728
\pnum
1472914729
\returns
14730-
\tcode{format("\{\}", *this)}.
14730+
\tcode{std::format("\{\}", *this)}.
1473114731
\begin{note}
1473214732
The returned string is suitable for use with formatting\iref{format.functions}
1473314733
and print functions\iref{print.fun}.
@@ -14801,7 +14801,7 @@
1480114801
\begin{itemdescr}
1480214802
\pnum
1480314803
\returns
14804-
\tcode{format("\{:g\}", *this)}.
14804+
\tcode{std::format("\{:g\}", *this)}.
1480514805
\begin{note}
1480614806
The returned string is suitable for use with formatting\iref{format.functions}
1480714807
and print functions\iref{print.fun}.

source/lex.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,9 @@
586586
or an operator or punctuator.
587587

588588
\pnum
589+
\indexgrammar{\idxgram{import-keyword}}%
590+
\indexgrammar{\idxgram{module-keyword}}%
591+
\indexgrammar{\idxgram{export-keyword}}%
589592
The \grammarterm{import-keyword} is produced
590593
by processing an \keyword{import} directive\iref{cpp.import},
591594
the \grammarterm{module-keyword} is produced

source/meta.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5222,7 +5222,7 @@
52225222
\end{itemdescr}
52235223

52245224
\begin{itemdecl}
5225-
static consteval access_context @\libmember{via}{access_context}@(info cls) const;
5225+
consteval access_context @\libmember{via}{access_context}@(info cls) const;
52265226
\end{itemdecl}
52275227

52285228
\begin{itemdescr}
@@ -6281,7 +6281,7 @@
62816281
initialized with \tcode{\{[:$V$:]...\}}.
62826282
\item
62836283
Otherwise, the template parameter object
6284-
of type \tcode{array<T, 0>}
6284+
of type \tcode{const array<T, 0>}
62856285
initialized with \tcode{\{\}}.
62866286
\end{itemize}
62876287

source/numerics.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12793,8 +12793,9 @@
1279312793
using offset_policy = conjugated_accessor<NestedAccessor::offset_policy>;
1279412794

1279512795
constexpr conjugated_accessor() = default;
12796+
constexpr conjugated_accessor(const NestedAccessor& acc);
1279612797
template<class OtherNestedAccessor>
12797-
explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>)
12798+
explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>)
1279812799
constexpr conjugated_accessor(const conjugated_accessor<OtherNestedAccessor>& other);
1279912800

1280012801
constexpr reference access(data_handle_type p, size_t i) const;
@@ -12838,7 +12839,7 @@
1283812839
\indexlibraryctor{conjugated_accessor}%
1283912840
\begin{itemdecl}
1284012841
template<class OtherNestedAccessor>
12841-
explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>)
12842+
explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>)
1284212843
constexpr conjugated_accessor(const conjugated_accessor<OtherNestedAccessor>& other);
1284312844
\end{itemdecl}
1284412845

source/threads.tex

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,10 @@
534534
class stop_source;
535535

536536
// no-shared-stop-state indicator
537-
struct nostopstate_t {
537+
struct @\libglobal{nostopstate_t}@ {
538538
explicit nostopstate_t() = default;
539539
};
540-
inline constexpr nostopstate_t nostopstate{};
540+
inline constexpr nostopstate_t @\libglobal{nostopstate}@{};
541541

542542
// \ref{stopcallback}, class template \tcode{stop_callback}
543543
template<class Callback>
@@ -557,7 +557,7 @@
557557
class inplace_stop_callback;
558558

559559
template<class T, class CallbackFn>
560-
using stop_callback_for_t = T::template callback_type<CallbackFn>;
560+
using @\libglobal{stop_callback_for_t}@ = T::template callback_type<CallbackFn>;
561561
}
562562
\end{codeblock}
563563

@@ -835,7 +835,7 @@
835835
class stop_token {
836836
public:
837837
template<class CallbackFn>
838-
using callback_type = stop_callback<CallbackFn>;
838+
using @\libmember{callback_type}{stop_token}@ = stop_callback<CallbackFn>;
839839

840840
stop_token() noexcept = default;
841841

@@ -1043,7 +1043,7 @@
10431043
template<class CallbackFn>
10441044
class stop_callback {
10451045
public:
1046-
using callback_type = CallbackFn;
1046+
using @\libmember{callback_type}{stop_callback}@ = CallbackFn;
10471047

10481048
// \ref{stopcallback.cons}, constructors and destructor
10491049
template<class Initializer>
@@ -1133,6 +1133,7 @@
11331133
It provides a stop token interface,
11341134
but also provides static information
11351135
that a stop is never possible nor requested.
1136+
\indexlibraryglobal{never_stop_token}%
11361137
\begin{codeblock}
11371138
namespace std {
11381139
class never_stop_token {
@@ -1141,10 +1142,10 @@
11411142
};
11421143
public:
11431144
template<class>
1144-
using callback_type = @\exposid{callback-type}@;
1145+
using @\libmember{callback_type}{never_stop_token}@ = @\exposid{callback-type}@;
11451146

1146-
static constexpr bool stop_requested() noexcept { return false; }
1147-
static constexpr bool stop_possible() noexcept { return false; }
1147+
static constexpr bool @\libmember{stop_requested}{never_stop_token}@() noexcept { return false; }
1148+
static constexpr bool @\libmember{stop_possible}{never_stop_token}@() noexcept { return false; }
11481149

11491150
bool operator==(const never_stop_token&) const = default;
11501151
};
@@ -1161,12 +1162,13 @@
11611162
It references the stop state of
11621163
its associated \tcode{inplace_stop_source} object\iref{stopsource.inplace},
11631164
if any.
1165+
\indexlibraryglobal{inplace_stop_token}%
11641166
\begin{codeblock}
11651167
namespace std {
11661168
class inplace_stop_token {
11671169
public:
11681170
template<class CallbackFn>
1169-
using callback_type = inplace_stop_callback<CallbackFn>;
1171+
using @\libmember{callback_type}{inplace_stop_token}@ = inplace_stop_callback<CallbackFn>;
11701172

11711173
inplace_stop_token() = default;
11721174
bool operator==(const inplace_stop_token&) const = default;
@@ -1184,6 +1186,7 @@
11841186

11851187
\rSec3[stoptoken.inplace.mem]{Member functions}
11861188

1189+
\indexlibrarymember{swap}{inplace_stop_token}%
11871190
\begin{itemdecl}
11881191
void swap(inplace_stop_token& rhs) noexcept;
11891192
\end{itemdecl}
@@ -1194,6 +1197,7 @@
11941197
Exchanges the values of \exposid{stop-source} and \tcode{rhs.\exposid{stop-source}}.
11951198
\end{itemdescr}
11961199

1200+
\indexlibrarymember{stop_requested}{inplace_stop_token}%
11971201
\begin{itemdecl}
11981202
bool stop_requested() const noexcept;
11991203
\end{itemdecl}
@@ -1215,6 +1219,7 @@
12151219
\end{note}
12161220
\end{itemdescr}
12171221

1222+
\indexlibrarymember{stop_possible}{inplace_stop_token}%
12181223
\begin{itemdecl}
12191224
stop_possible() const noexcept;
12201225
\end{itemdecl}
@@ -1241,6 +1246,7 @@
12411246
\pnum
12421247
The class \tcode{inplace_stop_source} models \exposconcept{stoppable-source}.
12431248

1249+
\indexlibraryglobal{inplace_stop_source}%
12441250
\begin{codeblock}
12451251
namespace std {
12461252
class inplace_stop_source {
@@ -1256,7 +1262,7 @@
12561262

12571263
// \ref{stopsource.inplace.mem}, stop handling
12581264
constexpr inplace_stop_token get_token() const noexcept;
1259-
static constexpr bool stop_possible() noexcept { return true; }
1265+
static constexpr bool @\libmember{stop_possible}{inplace_stop_source}@() noexcept { return true; }
12601266
bool stop_requested() const noexcept;
12611267
bool request_stop() noexcept;
12621268
};
@@ -1265,6 +1271,7 @@
12651271

12661272
\rSec3[stopsource.inplace.cons]{Constructors}
12671273

1274+
\indexlibraryctor{inplace_stop_source}%
12681275
\begin{itemdecl}
12691276
constexpr inplace_stop_source() noexcept;
12701277
\end{itemdecl}
@@ -1281,6 +1288,7 @@
12811288

12821289
\rSec3[stopsource.inplace.mem]{Member functions}
12831290

1291+
\indexlibrarymember{get_token}{inplace_stop_source}%
12841292
\begin{itemdecl}
12851293
constexpr inplace_stop_token get_token() const noexcept;
12861294
\end{itemdecl}
@@ -1292,6 +1300,7 @@
12921300
whose \exposid{stop-source} member is equal to \tcode{this}.
12931301
\end{itemdescr}
12941302

1303+
\indexlibrarymember{stop_requested}{inplace_stop_source}%
12951304
\begin{itemdecl}
12961305
bool stop_requested() const noexcept;
12971306
\end{itemdecl}
@@ -1303,6 +1312,7 @@
13031312
has received a stop request; otherwise, \tcode{false}.
13041313
\end{itemdescr}
13051314

1315+
\indexlibrarymember{request_stop}{inplace_stop_source}%
13061316
\begin{itemdecl}
13071317
bool request_stop() noexcept;
13081318
\end{itemdecl}
@@ -1321,12 +1331,13 @@
13211331

13221332
\rSec3[stopcallback.inplace.general]{General}
13231333

1334+
\indexlibraryglobal{inplace_stop_callback}%
13241335
\begin{codeblock}
13251336
namespace std {
13261337
template<class CallbackFn>
13271338
class inplace_stop_callback {
13281339
public:
1329-
using callback_type = CallbackFn;
1340+
using @\libmember{callback_type}{inplace_stop_callback}@ = CallbackFn;
13301341

13311342
// \ref{stopcallback.inplace.cons}, constructors and destructor
13321343
template<class Initializer>
@@ -1371,6 +1382,7 @@
13711382

13721383
\rSec3[stopcallback.inplace.cons]{Constructors and destructor}
13731384

1385+
\indexlibraryctor{inplace_stop_callback}%
13741386
\begin{itemdecl}
13751387
template<class Initializer>
13761388
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
@@ -1388,6 +1400,7 @@
13881400
and executes a stoppable callback registration\iref{stoptoken.concepts}.
13891401
\end{itemdescr}
13901402

1403+
\indexlibrarydtor{inplace_stop_callback}%
13911404
\begin{itemdecl}
13921405
~inplace_stop_callback();
13931406
\end{itemdecl}

0 commit comments

Comments
 (0)