|
3150 | 3150 | namespace std { |
3151 | 3151 | template<class T> struct atomic_ref { |
3152 | 3152 | private: |
3153 | | - T* ptr; // \expos |
| 3153 | + T* @\exposid{ptr}@; // \expos |
3154 | 3154 |
|
3155 | 3155 | public: |
3156 | 3156 | using value_type = remove_cv_t<T>; |
|
3191 | 3191 |
|
3192 | 3192 | \pnum |
3193 | 3193 | An \tcode{atomic_ref} object applies atomic operations\iref{atomics.general} to |
3194 | | -the object referenced by \tcode{*ptr} such that, |
| 3194 | +the object referenced by \tcode{*\exposid{ptr}} such that, |
3195 | 3195 | for the lifetime\iref{basic.life} of the \tcode{atomic_ref} object, |
3196 | | -the object referenced by \tcode{*ptr} is an atomic object\iref{intro.races}. |
| 3196 | +the object referenced by \tcode{*\exposid{ptr}} is an atomic object\iref{intro.races}. |
3197 | 3197 |
|
3198 | 3198 | \pnum |
3199 | 3199 | The program is ill-formed if \tcode{is_trivially_copyable_v<T>} is \tcode{false}. |
3200 | 3200 |
|
3201 | 3201 | \pnum |
3202 | | -The lifetime\iref{basic.life} of an object referenced by \tcode{*ptr} |
| 3202 | +The lifetime\iref{basic.life} of an object referenced by \tcode{*\exposid{ptr}} |
3203 | 3203 | shall exceed the lifetime of all \tcode{atomic_ref}s that reference the object. |
3204 | 3204 | While any \tcode{atomic_ref} instances exist |
3205 | | -that reference the \tcode{*ptr} object, |
| 3205 | +that reference the \tcode{*\exposid{ptr}} object, |
3206 | 3206 | all accesses to that object shall exclusively occur |
3207 | 3207 | through those \tcode{atomic_ref} instances. |
3208 | 3208 | No subobject of the object referenced by \tcode{atomic_ref} |
|
3356 | 3356 |
|
3357 | 3357 | \pnum |
3358 | 3358 | \effects |
3359 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3359 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3360 | 3360 | with the value of \tcode{desired}. |
3361 | 3361 | Memory is affected according to the value of \tcode{order}. |
3362 | 3362 | \end{itemdescr} |
|
3405 | 3405 |
|
3406 | 3406 | \pnum |
3407 | 3407 | \returns |
3408 | | -Atomically returns the value referenced by \tcode{*ptr}. |
| 3408 | +Atomically returns the value referenced by \tcode{*\exposid{ptr}}. |
3409 | 3409 | \end{itemdescr} |
3410 | 3410 |
|
3411 | 3411 | \indexlibrarymember{operator \placeholder{type}}{atomic_ref}% |
|
3438 | 3438 |
|
3439 | 3439 | \pnum |
3440 | 3440 | \effects |
3441 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3441 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3442 | 3442 | with \tcode{desired}. |
3443 | 3443 | Memory is affected according to the value of \tcode{order}. |
3444 | 3444 | This operation is an atomic read-modify-write operation\iref{intro.multithread}. |
3445 | 3445 |
|
3446 | 3446 | \pnum |
3447 | 3447 | \returns |
3448 | | -Atomically returns the value referenced by \tcode{*ptr} |
| 3448 | +Atomically returns the value referenced by \tcode{*\exposid{ptr}} |
3449 | 3449 | immediately before the effects. |
3450 | 3450 | \end{itemdescr} |
3451 | 3451 |
|
|
3487 | 3487 | \effects |
3488 | 3488 | Retrieves the value in \tcode{expected}. |
3489 | 3489 | It then atomically compares the value representation of |
3490 | | -the value referenced by \tcode{*ptr} for equality |
| 3490 | +the value referenced by \tcode{*\exposid{ptr}} for equality |
3491 | 3491 | with that previously retrieved from \tcode{expected}, |
3492 | | -and if \tcode{true}, replaces the value referenced by \tcode{*ptr} |
| 3492 | +and if \tcode{true}, replaces the value referenced by \tcode{*\exposid{ptr}} |
3493 | 3493 | with that in \tcode{desired}. |
3494 | 3494 | If and only if the comparison is \tcode{true}, |
3495 | 3495 | memory is affected according to the value of \tcode{success}, and |
|
3505 | 3505 | If and only if the comparison is \tcode{false} then, |
3506 | 3506 | after the atomic operation, |
3507 | 3507 | the value in \tcode{expected} is replaced by |
3508 | | -the value read from the value referenced by \tcode{*ptr} |
| 3508 | +the value read from the value referenced by \tcode{*\exposid{ptr}} |
3509 | 3509 | during the atomic comparison. |
3510 | 3510 | If the operation returns \tcode{true}, |
3511 | 3511 | these operations are atomic read-modify-write operations\iref{intro.races} |
3512 | | -on the value referenced by \tcode{*ptr}. |
| 3512 | +on the value referenced by \tcode{*\exposid{ptr}}. |
3513 | 3513 | Otherwise, these operations are atomic load operations on that memory. |
3514 | 3514 |
|
3515 | 3515 | \pnum |
|
3520 | 3520 | \remarks |
3521 | 3521 | A weak compare-and-exchange operation may fail spuriously. |
3522 | 3522 | That is, even when the contents of memory referred to |
3523 | | -by \tcode{expected} and \tcode{ptr} are equal, |
| 3523 | +by \tcode{expected} and \exposid{ptr} are equal, |
3524 | 3524 | it may return \tcode{false} and |
3525 | 3525 | store back to \tcode{expected} the same memory contents |
3526 | 3526 | that were originally there. |
|
3566 | 3566 | \pnum |
3567 | 3567 | \remarks |
3568 | 3568 | This function is an atomic waiting operation\iref{atomics.wait} |
3569 | | -on atomic object \tcode{*ptr}. |
| 3569 | +on atomic object \tcode{*\exposid{ptr}}. |
3570 | 3570 | \end{itemdescr} |
3571 | 3571 |
|
3572 | 3572 | \indexlibrarymember{notify_one}{atomic_ref<T>}% |
|
3581 | 3581 |
|
3582 | 3582 | \pnum |
3583 | 3583 | \effects |
3584 | | -Unblocks the execution of at least one atomic waiting operation on \tcode{*ptr} |
| 3584 | +Unblocks the execution of at least one atomic waiting operation on \tcode{*\exposid{ptr}} |
3585 | 3585 | that is eligible to be unblocked\iref{atomics.wait} by this call, |
3586 | 3586 | if any such atomic waiting operations exist. |
3587 | 3587 |
|
3588 | 3588 | \pnum |
3589 | 3589 | \remarks |
3590 | 3590 | This function is an atomic notifying operation\iref{atomics.wait} |
3591 | | -on atomic object \tcode{*ptr}. |
| 3591 | +on atomic object \tcode{*\exposid{ptr}}. |
3592 | 3592 | \end{itemdescr} |
3593 | 3593 |
|
3594 | 3594 | \indexlibrarymember{notify_all}{atomic_ref<T>}% |
|
3603 | 3603 |
|
3604 | 3604 | \pnum |
3605 | 3605 | \effects |
3606 | | -Unblocks the execution of all atomic waiting operations on \tcode{*ptr} |
| 3606 | +Unblocks the execution of all atomic waiting operations on \tcode{*\exposid{ptr}} |
3607 | 3607 | that are eligible to be unblocked\iref{atomics.wait} by this call. |
3608 | 3608 |
|
3609 | 3609 | \pnum |
3610 | 3610 | \remarks |
3611 | 3611 | This function is an atomic notifying operation\iref{atomics.wait} |
3612 | | -on atomic object \tcode{*ptr}. |
| 3612 | +on atomic object \tcode{*\exposid{ptr}}. |
3613 | 3613 | \end{itemdescr} |
3614 | 3614 |
|
3615 | 3615 | \indexlibrarymember{address}{atomic_ref<T>}% |
|
3620 | 3620 | \begin{itemdescr} |
3621 | 3621 | \pnum |
3622 | 3622 | \returns |
3623 | | -\tcode{ptr}. |
| 3623 | +\exposid{ptr}. |
3624 | 3624 | \end{itemdescr} |
3625 | 3625 |
|
3626 | 3626 | \rSec3[atomics.ref.int]{Specializations for integral types} |
|
3646 | 3646 | namespace std { |
3647 | 3647 | template<> struct atomic_ref<@\placeholder{integral-type}@> { |
3648 | 3648 | private: |
3649 | | - @\placeholder{integral-type}@* ptr; // \expos |
| 3649 | + @\placeholder{integral-type}@* @\exposid{ptr}@; // \expos |
3650 | 3650 |
|
3651 | 3651 | public: |
3652 | 3652 | using value_type = remove_cv_t<@\placeholder{integral-type}@>; |
|
3754 | 3754 |
|
3755 | 3755 | \pnum |
3756 | 3756 | \effects |
3757 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
3758 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 3757 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 3758 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
3759 | 3759 | and the given operand. |
3760 | 3760 | Memory is affected according to the value of \tcode{order}. |
3761 | 3761 | These operations are atomic read-modify-write operations\iref{intro.races}. |
3762 | 3762 |
|
3763 | 3763 | \pnum |
3764 | 3764 | \returns |
3765 | | -Atomically, the value referenced by \tcode{*ptr} |
| 3765 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
3766 | 3766 | immediately before the effects. |
3767 | 3767 |
|
3768 | 3768 | \pnum |
|
3808 | 3808 |
|
3809 | 3809 | \pnum |
3810 | 3810 | \effects |
3811 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 3811 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
3812 | 3812 | with the result of the computation applied to |
3813 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 3813 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
3814 | 3814 | Memory is affected according to the value of \tcode{order}. |
3815 | 3815 | These operations are atomic modify-write operations\iref{atomics.order}. |
3816 | 3816 |
|
3817 | 3817 | \pnum |
3818 | 3818 | \remarks |
3819 | 3819 | Except for \tcode{store_max} and \tcode{store_min}, |
3820 | 3820 | for signed integer types, |
3821 | | -the result is as if \tcode{*ptr} and parameters |
| 3821 | +the result is as if \tcode{*\exposid{ptr}} and parameters |
3822 | 3822 | were converted to their corresponding unsigned types, |
3823 | 3823 | the computation performed on those types, and |
3824 | 3824 | the result converted back to the signed type. |
|
3828 | 3828 | For \tcode{store_max} and \tcode{store_min}, |
3829 | 3829 | the maximum and minimum computation is performed |
3830 | 3830 | as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, |
3831 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 3831 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
3832 | 3832 | \end{itemdescr} |
3833 | 3833 |
|
3834 | 3834 | \indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}% |
|
3870 | 3870 | namespace std { |
3871 | 3871 | template<> struct atomic_ref<@\placeholder{floating-point-type}@> { |
3872 | 3872 | private: |
3873 | | - @\placeholder{floating-point-type}@* ptr; // \expos |
| 3873 | + @\placeholder{floating-point-type}@* @\exposid{ptr}@; // \expos |
3874 | 3874 |
|
3875 | 3875 | public: |
3876 | 3876 | using value_type = remove_cv_t<@\placeholder{floating-point-type}@>; |
|
3983 | 3983 |
|
3984 | 3984 | \pnum |
3985 | 3985 | \effects |
3986 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
3987 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 3986 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 3987 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
3988 | 3988 | and the given operand. |
3989 | 3989 | Memory is affected according to the value of \tcode{order}. |
3990 | 3990 | These operations are atomic read-modify-write operations\iref{intro.races}. |
3991 | 3991 |
|
3992 | 3992 | \pnum |
3993 | 3993 | \returns |
3994 | | -Atomically, the value referenced by \tcode{*ptr} |
| 3994 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
3995 | 3995 | immediately before the effects. |
3996 | 3996 |
|
3997 | 3997 | \pnum |
|
4012 | 4012 | For \tcode{fetch_fmaximum} and \tcode{fetch_fminimum}, |
4013 | 4013 | the maximum and minimum computation is performed |
4014 | 4014 | as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, |
4015 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4015 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4016 | 4016 | \item |
4017 | 4017 | For \tcode{fetch_fmaximum_num} and \tcode{fetch_fminimum_num}, |
4018 | 4018 | the maximum and minimum computation is performed |
4019 | 4019 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4020 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4020 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4021 | 4021 | \item |
4022 | 4022 | For \tcode{fetch_max} and \tcode{fetch_min}, |
4023 | 4023 | the maximum and minimum computation is performed |
4024 | 4024 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4025 | | -with \tcode{*ptr} and the first parameter as the arguments, except that: |
| 4025 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: |
4026 | 4026 | \begin{itemize} |
4027 | 4027 | \item |
4028 | | -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. |
| 4028 | +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. |
4029 | 4029 | \item |
4030 | 4030 | If exactly one argument is a NaN, |
4031 | | -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}; |
| 4031 | +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}; |
4032 | 4032 | it is unspecified which. |
4033 | 4033 | \item |
4034 | 4034 | If the arguments are differently signed zeros, |
4035 | | -which of these values is stored at \tcode{*ptr} is unspecified. |
| 4035 | +which of these values is stored at \tcode{*\exposid{ptr}} is unspecified. |
4036 | 4036 | \end{itemize} |
4037 | 4037 | \end{itemize} |
4038 | 4038 |
|
|
4068 | 4068 |
|
4069 | 4069 | \pnum |
4070 | 4070 | \effects |
4071 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 4071 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
4072 | 4072 | with the result of the computation applied to |
4073 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 4073 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
4074 | 4074 | Memory is affected according to the value of \tcode{order}. |
4075 | 4075 | These operations are atomic modify-write operations\iref{atomics.order}. |
4076 | 4076 |
|
|
4098 | 4098 | For \tcode{store_fmaximum} and \tcode{store_fminimum}, |
4099 | 4099 | the maximum and minimum computation is performed |
4100 | 4100 | as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, |
4101 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4101 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4102 | 4102 | \item |
4103 | 4103 | For \tcode{store_fmaximum_num} and \tcode{store_fminimum_num}, |
4104 | 4104 | the maximum and minimum computation is performed |
4105 | 4105 | as if by \tcode{fmaximum_num }and \tcode{fminimum_num}, respectively, |
4106 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4106 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4107 | 4107 | \item |
4108 | 4108 | For \tcode{store_max} and \tcode{store_min}, |
4109 | 4109 | the maximum and minimum computation is performed |
4110 | 4110 | as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, |
4111 | | -with \tcode{*ptr} and the first parameter as the arguments, except that: |
| 4111 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: |
4112 | 4112 | \begin{itemize} |
4113 | 4113 | \item |
4114 | | -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. |
| 4114 | +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. |
4115 | 4115 | \item |
4116 | 4116 | If exactly one argument is a NaN, |
4117 | | -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}, |
| 4117 | +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}, |
4118 | 4118 | it is unspecified which. |
4119 | 4119 | \item |
4120 | 4120 | If the arguments are differently signed zeros, |
|
4164 | 4164 | namespace std { |
4165 | 4165 | template<> struct atomic_ref<@\placeholder{pointer-type}@> { |
4166 | 4166 | private: |
4167 | | - @\placeholder{pointer-type}@* ptr; // \expos |
| 4167 | + @\placeholder{pointer-type}@* @\exposid{ptr}@; // \expos |
4168 | 4168 |
|
4169 | 4169 | public: |
4170 | 4170 | using value_type = remove_cv_t<@\placeholder{pointer-type}@>; |
|
4258 | 4258 |
|
4259 | 4259 | \pnum |
4260 | 4260 | \effects |
4261 | | -Atomically replaces the value referenced by \tcode{*ptr} with |
4262 | | -the result of the computation applied to the value referenced by \tcode{*ptr} |
| 4261 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with |
| 4262 | +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} |
4263 | 4263 | and the given operand. |
4264 | 4264 | Memory is affected according to the value of \tcode{order}. |
4265 | 4265 | These operations are atomic read-modify-write operations\iref{intro.races}. |
4266 | 4266 |
|
4267 | 4267 | \pnum |
4268 | 4268 | \returns |
4269 | | -Atomically, the value referenced by \tcode{*ptr} |
| 4269 | +Atomically, the value referenced by \tcode{*\exposid{ptr}} |
4270 | 4270 | immediately before the effects. |
4271 | 4271 |
|
4272 | 4272 | \pnum |
|
4313 | 4313 |
|
4314 | 4314 | \pnum |
4315 | 4315 | \effects |
4316 | | -Atomically replaces the value referenced by \tcode{*ptr} |
| 4316 | +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} |
4317 | 4317 | with the result of the computation applied to |
4318 | | -the value referenced by \tcode{*ptr} and the given \tcode{operand}. |
| 4318 | +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. |
4319 | 4319 | Memory is affected according to the value of \tcode{order}. |
4320 | 4320 | These operations are atomic modify-write operations\iref{atomics.order}. |
4321 | 4321 |
|
|
4326 | 4326 | For \tcode{store_max} and \tcode{store_min}, |
4327 | 4327 | the \tcode{maximum} and \tcode{minimum} computation is performed |
4328 | 4328 | as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, |
4329 | | -with \tcode{*ptr} and the first parameter as the arguments. |
| 4329 | +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. |
4330 | 4330 | \begin{note} |
4331 | 4331 | If the pointers point to different complete objects (or subobjects thereof), |
4332 | 4332 | the \tcode{<} operator does not establish |
|
0 commit comments