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