Skip to content

Commit 58c68f9

Browse files
mclowzygoloid
authored andcommitted
P1723R2 Mandating the Standard Library: Clause 31 - Atomics library
1 parent a8edf94 commit 58c68f9

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

source/atomics.tex

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@
743743
the object referenced by \tcode{*ptr} is an atomic object\iref{intro.races}.
744744

745745
\pnum
746-
The template argument for \tcode{T}
747-
shall be trivially copyable\iref{basic.types}.
746+
The program is ill-formed if \tcode{is_trivially_copyable_v<T>} is \tcode{false}.
748747

749748
\pnum
750749
The lifetime\iref{basic.life} of an object referenced by \tcode{*ptr}
@@ -836,11 +835,12 @@
836835

837836
\begin{itemdescr}
838837
\pnum
839-
\requires The referenced object shall be aligned to \tcode{required_alignment}.
838+
\expects
839+
The referenced object is aligned to \tcode{required_alignment}.
840840

841841
\pnum
842-
\effects
843-
Constructs an atomic reference that references the object.
842+
\ensures
843+
\tcode{*this} references \tcode{obj}.
844844

845845
\pnum
846846
\throws
@@ -857,9 +857,8 @@
857857

858858
\begin{itemdescr}
859859
\pnum
860-
\effects
861-
Constructs an atomic reference
862-
that references the object referenced by \tcode{ref}.
860+
\ensures
861+
\tcode{*this} references the object referenced by \tcode{ref}.
863862
\end{itemdescr}
864863

865864
\indexlibrarymember{store}{atomic_ref}%
@@ -872,7 +871,8 @@
872871

873872
\begin{itemdescr}
874873
\pnum
875-
\requires The \tcode{order} argument shall not be
874+
\expects
875+
The \tcode{order} argument is neither
876876
\tcode{memory_order_consume},
877877
\tcode{memory_order_acquire}, nor
878878
\tcode{memory_order_acq_rel}.
@@ -912,7 +912,8 @@
912912

913913
\begin{itemdescr}
914914
\pnum
915-
\requires The \tcode{order} argument shall not be
915+
\expects
916+
The \tcode{order} argument is neither
916917
\tcode{memory_order_release} nor \tcode{memory_order_acq_rel}.
917918

918919
\pnum
@@ -984,7 +985,8 @@
984985

985986
\begin{itemdescr}
986987
\pnum
987-
\requires The \tcode{failure} argument shall not be
988+
\expects
989+
The \tcode{failure} argument is neither
988990
\tcode{memory_order_release} nor \tcode{memory_order_acq_rel}.
989991

990992
\pnum
@@ -1443,8 +1445,8 @@
14431445

14441446
\begin{itemdescr}
14451447
\pnum
1446-
\requires \tcode{T} shall be an object type,
1447-
otherwise the program is ill-formed.
1448+
\mandates
1449+
\tcode{T} is a complete object type.
14481450

14491451
\pnum
14501452
\effects
@@ -1710,7 +1712,8 @@
17101712

17111713
\begin{itemdescr}
17121714
\pnum
1713-
\requires The \tcode{order} argument shall not be \tcode{memory_order::consume},
1715+
\expects
1716+
The \tcode{order} argument is neither \tcode{memory_order::consume},
17141717
\tcode{memory_order::acquire}, nor \tcode{memory_order::acq_rel}.
17151718

17161719
\pnum
@@ -1752,7 +1755,8 @@
17521755

17531756
\begin{itemdescr}
17541757
\pnum
1755-
\requires The \tcode{order} argument shall not be \tcode{memory_order::release} nor \tcode{memory_order::acq_rel}.
1758+
\expects
1759+
The \tcode{order} argument is neither \tcode{memory_order::release} nor \tcode{memory_order::acq_rel}.
17561760

17571761
\pnum
17581762
\effects
@@ -1836,7 +1840,8 @@
18361840

18371841
\begin{itemdescr}
18381842
\pnum
1839-
\requires The \tcode{failure} argument shall not be \tcode{memory_order::release} nor
1843+
\expects
1844+
The \tcode{failure} argument is neither \tcode{memory_order::release} nor
18401845
\tcode{memory_order::acq_rel}.
18411846

18421847
\pnum
@@ -2539,7 +2544,8 @@
25392544

25402545
\begin{itemdescr}
25412546
\pnum
2542-
\requires T shall be an object type, otherwise the program is ill-formed.
2547+
\mandates
2548+
\tcode{T} is a complete object type.
25432549
\begin{note}
25442550
Pointer arithmetic on \tcode{void*} or function pointers is ill-formed.
25452551
\end{note}
@@ -3414,7 +3420,8 @@
34143420

34153421
\begin{itemdescr}
34163422
\pnum
3417-
\requires The \tcode{order} argument shall not be \tcode{memory_order::consume},
3423+
\expects
3424+
The \tcode{order} argument is neither \tcode{memory_order::consume},
34183425
\tcode{memory_order::acquire}, nor \tcode{memory_order::acq_rel}.
34193426

34203427
\pnum

source/future.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@
25572557
\begin{itemdescr}
25582558
\pnum
25592559
\remarks
2560-
The macro \tcode{ATOMIC_FLAG_INIT} shall be defined in such a way that
2560+
The macro \tcode{ATOMIC_FLAG_INIT} is defined in such a way that
25612561
it can be used to initialize an object of type \tcode{atomic_flag}
25622562
to the clear state.
25632563
The macro can be used in the form:

0 commit comments

Comments
 (0)