|
3202 | 3202 | namespace std { |
3203 | 3203 | template<class T> struct atomic_ref { |
3204 | 3204 | private: |
3205 | | - T* ptr; // \expos |
| 3205 | + T* @\exposid{ptr}@; // \expos |
3206 | 3206 |
|
3207 | 3207 | public: |
3208 | 3208 | using value_type = remove_cv_t<T>; |
|
3241 | 3241 |
|
3242 | 3242 | \pnum |
3243 | 3243 | An \tcode{atomic_ref} object applies atomic operations\iref{atomics.general} to |
3244 | | -the object referenced by \tcode{*ptr} such that, |
| 3244 | +the object referenced by \tcode{*\exposid{ptr}} such that, |
3245 | 3245 | for the lifetime\iref{basic.life} of the \tcode{atomic_ref} object, |
3246 | | -the object referenced by \tcode{*ptr} is an atomic object\iref{intro.races}. |
| 3246 | +the object referenced by \tcode{*\exposid{ptr}} is an atomic object\iref{intro.races}. |
3247 | 3247 |
|
3248 | 3248 | \pnum |
3249 | 3249 | The program is ill-formed if \tcode{is_trivially_copyable_v<T>} is \tcode{false}. |
3250 | 3250 |
|
3251 | 3251 | \pnum |
3252 | | -The lifetime\iref{basic.life} of an object referenced by \tcode{*ptr} |
| 3252 | +The lifetime\iref{basic.life} of an object referenced by \tcode{*\exposid{ptr}} |
3253 | 3253 | shall exceed the lifetime of all \tcode{atomic_ref}s that reference the object. |
3254 | 3254 | While any \tcode{atomic_ref} instances exist |
3255 | | -that reference the \tcode{*ptr} object, |
| 3255 | +that reference the \tcode{*\exposid{ptr}} object, |
3256 | 3256 | all accesses to that object shall exclusively occur |
3257 | 3257 | through those \tcode{atomic_ref} instances. |
3258 | 3258 | No subobject of the object referenced by \tcode{atomic_ref} |
|
3392 | 3392 |
|
3393 | 3393 | \pnum |
3394 | 3394 | \effects |
3395 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3395 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3396 | 3396 | with the value of \tcode{desired}. |
3397 | 3397 | Memory is affected according to the value of \tcode{order}. |
3398 | 3398 | \end{itemdescr} |
|
3441 | 3441 |
|
3442 | 3442 | \pnum |
3443 | 3443 | \returns |
3444 | | -Atomically returns the value referenced by \tcode{*ptr}. |
| 3444 | +Atomically returns the value referenced by \tcode{*\exposid{ptr}}. |
3445 | 3445 | \end{itemdescr} |
3446 | 3446 |
|
3447 | 3447 | \indexlibrarymember{operator \placeholder{type}}{atomic_ref}% |
|
3474 | 3474 |
|
3475 | 3475 | \pnum |
3476 | 3476 | \effects |
3477 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3477 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3478 | 3478 | with \tcode{desired}. |
3479 | 3479 | Memory is affected according to the value of \tcode{order}. |
3480 | 3480 | This operation is an atomic read-modify-write operation\iref{intro.multithread}. |
3481 | 3481 |
|
3482 | 3482 | \pnum |
3483 | 3483 | \returns |
3484 | | -Atomically returns the value referenced by \tcode{*ptr} |
| 3484 | +Atomically returns the value referenced by \tcode{*\exposid{ptr}} |
3485 | 3485 | immediately before the effects. |
3486 | 3486 | \end{itemdescr} |
3487 | 3487 |
|
|
3523 | 3523 | \effects |
3524 | 3524 | Retrieves the value in \tcode{expected}. |
3525 | 3525 | It then atomically compares the value representation of |
3526 | | -the value referenced by \tcode{*ptr} for equality |
| 3526 | +the value referenced by \tcode{*\exposid{ptr}} for equality |
3527 | 3527 | with that previously retrieved from \tcode{expected}, |
3528 | | -and if \tcode{true}, replaces the value referenced by \tcode{*ptr} |
| 3528 | +and if \tcode{true}, replaces the value referenced by \tcode{*\exposid{ptr}} |
3529 | 3529 | with that in \tcode{desired}. |
3530 | 3530 | If and only if the comparison is \tcode{true}, |
3531 | 3531 | memory is affected according to the value of \tcode{success}, and |
|
3541 | 3541 | If and only if the comparison is \tcode{false} then, |
3542 | 3542 | after the atomic operation, |
3543 | 3543 | the value in \tcode{expected} is replaced by |
3544 | | -the value read from the value referenced by \tcode{*ptr} |
| 3544 | +the value read from the value referenced by \tcode{*\exposid{ptr}} |
3545 | 3545 | during the atomic comparison. |
3546 | 3546 | If the operation returns \tcode{true}, |
3547 | 3547 | these operations are atomic read-modify-write operations\iref{intro.races} |
3548 | | -on the value referenced by \tcode{*ptr}. |
| 3548 | +on the value referenced by \tcode{*\exposid{ptr}}. |
3549 | 3549 | Otherwise, these operations are atomic load operations on that memory. |
3550 | 3550 |
|
3551 | 3551 | \pnum |
|
3556 | 3556 | \remarks |
3557 | 3557 | A weak compare-and-exchange operation may fail spuriously. |
3558 | 3558 | That is, even when the contents of memory referred to |
3559 | | -by \tcode{expected} and \tcode{ptr} are equal, |
| 3559 | +by \tcode{expected} and \exposid{ptr} are equal, |
3560 | 3560 | it may return \tcode{false} and |
3561 | 3561 | store back to \tcode{expected} the same memory contents |
3562 | 3562 | that were originally there. |
|
3602 | 3602 | \pnum |
3603 | 3603 | \remarks |
3604 | 3604 | This function is an atomic waiting operation\iref{atomics.wait} |
3605 | | -on atomic object \tcode{*ptr}. |
| 3605 | +on atomic object \tcode{*\exposid{ptr}}. |
3606 | 3606 | \end{itemdescr} |
3607 | 3607 |
|
3608 | 3608 | \indexlibrarymember{notify_one}{atomic_ref<T>}% |
|
3617 | 3617 |
|
3618 | 3618 | \pnum |
3619 | 3619 | \effects |
3620 | | -Unblocks the execution of at least one atomic waiting operation on \tcode{*ptr} |
| 3620 | +Unblocks the execution of at least one atomic waiting operation on \tcode{*\exposid{ptr}} |
3621 | 3621 | that is eligible to be unblocked\iref{atomics.wait} by this call, |
3622 | 3622 | if any such atomic waiting operations exist. |
3623 | 3623 |
|
3624 | 3624 | \pnum |
3625 | 3625 | \remarks |
3626 | 3626 | This function is an atomic notifying operation\iref{atomics.wait} |
3627 | | -on atomic object \tcode{*ptr}. |
| 3627 | +on atomic object \tcode{*\exposid{ptr}}. |
3628 | 3628 | \end{itemdescr} |
3629 | 3629 |
|
3630 | 3630 | \indexlibrarymember{notify_all}{atomic_ref<T>}% |
|
3639 | 3639 |
|
3640 | 3640 | \pnum |
3641 | 3641 | \effects |
3642 | | -Unblocks the execution of all atomic waiting operations on \tcode{*ptr} |
| 3642 | +Unblocks the execution of all atomic waiting operations on \tcode{*\exposid{ptr}} |
3643 | 3643 | that are eligible to be unblocked\iref{atomics.wait} by this call. |
3644 | 3644 |
|
3645 | 3645 | \pnum |
3646 | 3646 | \remarks |
3647 | 3647 | This function is an atomic notifying operation\iref{atomics.wait} |
3648 | | -on atomic object \tcode{*ptr}. |
| 3648 | +on atomic object \tcode{*\exposid{ptr}}. |
3649 | 3649 | \end{itemdescr} |
3650 | 3650 |
|
3651 | 3651 | \indexlibrarymember{address}{atomic_ref<T>}% |
|
3656 | 3656 | \begin{itemdescr} |
3657 | 3657 | \pnum |
3658 | 3658 | \returns |
3659 | | -\tcode{ptr}. |
| 3659 | +\exposid{ptr}. |
3660 | 3660 | \end{itemdescr} |
3661 | 3661 |
|
3662 | 3662 | \rSec3[atomics.ref.int]{Specializations for integral types} |
|
3682 | 3682 | namespace std { |
3683 | 3683 | template<> struct atomic_ref<@\placeholder{integral-type}@> { |
3684 | 3684 | private: |
3685 | | - @\placeholder{integral-type}@* ptr; // \expos |
| 3685 | + @\placeholder{integral-type}@* @\exposid{ptr}@; // \expos |
3686 | 3686 |
|
3687 | 3687 | public: |
3688 | 3688 | using value_type = remove_cv_t<@\placeholder{integral-type}@>; |
|
3788 | 3788 |
|
3789 | 3789 | \pnum |
3790 | 3790 | \effects |
3791 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
3792 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 3791 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 3792 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
3793 | 3793 | and the given operand. |
3794 | 3794 | Memory is affected according to the value of \tcode{order}. |
3795 | 3795 | These operations are atomic read-modify-write operations\iref{intro.races}. |
3796 | 3796 |
|
3797 | 3797 | \pnum |
3798 | 3798 | \returns |
3799 | | -Atomically, the value referenced by \tcode{*ptr} |
| 3799 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
3800 | 3800 | immediately before the effects. |
3801 | 3801 |
|
3802 | 3802 | \pnum |
|
3838 | 3838 |
|
3839 | 3839 | \pnum |
3840 | 3840 | \effects |
3841 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3841 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3842 | 3842 | with the result of the computation applied to |
3843 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 3843 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
3844 | 3844 | Memory is affected according to the value of \tcode{order}. |
3845 | 3845 | These operations are atomic modify-write operations\iref{atomics.order}. |
3846 | 3846 |
|
3847 | 3847 | \pnum |
3848 | 3848 | \remarks |
3849 | 3849 | Except for \tcode{store_max} and \tcode{store_min}, |
3850 | 3850 | for signed integer types, |
3851 | | -the result is as if \tcode{*ptr} and parameters |
| 3851 | +the result is as if \tcode{*\exposid{ptr}} and parameters |
3852 | 3852 | were converted to their corresponding unsigned types, |
3853 | 3853 | the computation performed on those types, and |
3854 | 3854 | the result converted back to the signed type. |
|
3858 | 3858 | For \tcode{store_max} and \tcode{store_min}, |
3859 | 3859 | the maximum and minimum computation is performed |
3860 | 3860 | as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, |
3861 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 3861 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
3862 | 3862 | \end{itemdescr} |
3863 | 3863 |
|
3864 | 3864 | \indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}% |
|
3900 | 3900 | namespace std { |
3901 | 3901 | template<> struct atomic_ref<@\placeholder{floating-point-type}@> { |
3902 | 3902 | private: |
3903 | | - @\placeholder{floating-point-type}@* ptr; // \expos |
| 3903 | + @\placeholder{floating-point-type}@* @\exposid{ptr}@; // \expos |
3904 | 3904 |
|
3905 | 3905 | public: |
3906 | 3906 | using value_type = remove_cv_t<@\placeholder{floating-point-type}@>; |
|
4011 | 4011 |
|
4012 | 4012 | \pnum |
4013 | 4013 | \effects |
4014 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
4015 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 4014 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 4015 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
4016 | 4016 | and the given operand. |
4017 | 4017 | Memory is affected according to the value of \tcode{order}. |
4018 | 4018 | These operations are atomic read-modify-write operations\iref{intro.races}. |
4019 | 4019 |
|
4020 | 4020 | \pnum |
4021 | 4021 | \returns |
4022 | | -Atomically, the value referenced by \tcode{*ptr} |
| 4022 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
4023 | 4023 | immediately before the effects. |
4024 | 4024 |
|
4025 | 4025 | \pnum |
|
4040 | 4040 | For \tcode{fetch_fmaximum} and \tcode{fetch_fminimum}, |
4041 | 4041 | the maximum and minimum computation is performed |
4042 | 4042 | as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, |
4043 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4043 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4044 | 4044 | \item |
4045 | 4045 | For \tcode{fetch_fmaximum_num} and \tcode{fetch_fminimum_num}, |
4046 | 4046 | the maximum and minimum computation is performed |
4047 | 4047 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4048 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4048 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4049 | 4049 | \item |
4050 | 4050 | For \tcode{fetch_max} and \tcode{fetch_min}, |
4051 | 4051 | the maximum and minimum computation is performed |
4052 | 4052 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4053 | | -with \tcode{*ptr} and the first parameter as the arguments, except that: |
| 4053 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: |
4054 | 4054 | \begin{itemize} |
4055 | 4055 | \item |
4056 | | -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. |
| 4056 | +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. |
4057 | 4057 | \item |
4058 | 4058 | If exactly one argument is a NaN, |
4059 | | -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}; |
| 4059 | +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}; |
4060 | 4060 | it is unspecified which. |
4061 | 4061 | \item |
4062 | 4062 | If the arguments are differently signed zeros, |
4063 | | -which of these values is stored at \tcode{*ptr} is unspecified. |
| 4063 | +which of these values is stored at \tcode{*\exposid{ptr}} is unspecified. |
4064 | 4064 | \end{itemize} |
4065 | 4065 | \end{itemize} |
4066 | 4066 |
|
|
4092 | 4092 |
|
4093 | 4093 | \pnum |
4094 | 4094 | \effects |
4095 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 4095 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
4096 | 4096 | with the result of the computation applied to |
4097 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 4097 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
4098 | 4098 | Memory is affected according to the value of \tcode{order}. |
4099 | 4099 | These operations are atomic modify-write operations\iref{atomics.order}. |
4100 | 4100 |
|
|
4122 | 4122 | For \tcode{store_fmaximum} and \tcode{store_fminimum}, |
4123 | 4123 | the maximum and minimum computation is performed |
4124 | 4124 | as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, |
4125 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4125 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4126 | 4126 | \item |
4127 | 4127 | For \tcode{store_fmaximum_num} and \tcode{store_fminimum_num}, |
4128 | 4128 | the maximum and minimum computation is performed |
4129 | 4129 | as if by \tcode{fmaximum_num }and \tcode{fminimum_num}, respectively, |
4130 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4130 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4131 | 4131 | \item |
4132 | 4132 | For \tcode{store_max} and \tcode{store_min}, |
4133 | 4133 | the maximum and minimum computation is performed |
4134 | 4134 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4135 | | -with \tcode{*ptr} and the first parameter as the arguments, except that: |
| 4135 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: |
4136 | 4136 | \begin{itemize} |
4137 | 4137 | \item |
4138 | | -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. |
| 4138 | +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. |
4139 | 4139 | \item |
4140 | 4140 | If exactly one argument is a NaN, |
4141 | | -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}, |
| 4141 | +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}, |
4142 | 4142 | it is unspecified which. |
4143 | 4143 | \item |
4144 | 4144 | If the arguments are differently signed zeros, |
|
4188 | 4188 | namespace std { |
4189 | 4189 | template<class T> struct atomic_ref<@\placeholder{pointer-type}@> { |
4190 | 4190 | private: |
4191 | | - @\placeholder{pointer-type}@* ptr; // \expos |
| 4191 | + @\placeholder{pointer-type}@* @\exposid{ptr}@; // \expos |
4192 | 4192 |
|
4193 | 4193 | public: |
4194 | 4194 | using value_type = remove_cv_t<@\placeholder{pointer-type}@>; |
|
4280 | 4280 |
|
4281 | 4281 | \pnum |
4282 | 4282 | \effects |
4283 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
4284 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 4283 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 4284 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
4285 | 4285 | and the given operand. |
4286 | 4286 | Memory is affected according to the value of \tcode{order}. |
4287 | 4287 | These operations are atomic read-modify-write operations\iref{intro.races}. |
4288 | 4288 |
|
4289 | 4289 | \pnum |
4290 | 4290 | \returns |
4291 | | -Atomically, the value referenced by \tcode{*ptr} |
| 4291 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
4292 | 4292 | immediately before the effects. |
4293 | 4293 |
|
4294 | 4294 | \pnum |
|
4331 | 4331 |
|
4332 | 4332 | \pnum |
4333 | 4333 | \effects |
4334 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 4334 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
4335 | 4335 | with the result of the computation applied to |
4336 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 4336 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
4337 | 4337 | Memory is affected according to the value of \tcode{order}. |
4338 | 4338 | These operations are atomic modify-write operations\iref{atomics.order}. |
4339 | 4339 |
|
|
4344 | 4344 | For \tcode{store_max} and \tcode{store_min}, |
4345 | 4345 | the \tcode{maximum} and \tcode{minimum} computation is performed |
4346 | 4346 | as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, |
4347 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4347 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4348 | 4348 | \begin{note} |
4349 | 4349 | If the pointers point to different complete objects (or subobjects thereof), |
4350 | 4350 | the \tcode{<} operator does not establish |
|
0 commit comments