Skip to content

Commit f9f7900

Browse files
[thread.stoptoken] Add indexing for entities in <stop_token> (#8359)
1 parent 29465f5 commit f9f7900

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

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)