|
2265 | 2265 | template<class T>
|
2266 | 2266 | T atomic_fetch_xor_explicit(atomic<T>*, typename atomic<T>::value_type, // freestanding
|
2267 | 2267 | memory_order) noexcept;
|
2268 |
| - |
| 2268 | + template<class T> |
| 2269 | + T atomic_fetch_max(volatile atomic<T>*, // freestanding |
| 2270 | + typename atomic<T>::value_type) noexcept; |
| 2271 | + template<class T> |
| 2272 | + T atomic_fetch_max(atomic<T>*, // freestanding |
| 2273 | + typename atomic<T>::value_type) noexcept; |
| 2274 | + template<class T> |
| 2275 | + T atomic_fetch_max_explicit(volatile atomic<T>*, // freestanding |
| 2276 | + typename atomic<T>::value_type, |
| 2277 | + memory_order) noexcept; |
| 2278 | + template<class T> |
| 2279 | + T atomic_fetch_max_explicit(atomic<T>*, // freestanding |
| 2280 | + typename atomic<T>::value_type, |
| 2281 | + memory_order) noexcept; |
| 2282 | + template<class T> |
| 2283 | + T atomic_fetch_min(volatile atomic<T>*, // freestanding |
| 2284 | + typename atomic<T>::value_type) noexcept; |
| 2285 | + template<class T> |
| 2286 | + T atomic_fetch_min(atomic<T>*, // freestanding |
| 2287 | + typename atomic<T>::value_type) noexcept; |
| 2288 | + template<class T> |
| 2289 | + T atomic_fetch_min_explicit(volatile atomic<T>*, // freestanding |
| 2290 | + typename atomic<T>::value_type, |
| 2291 | + memory_order) noexcept; |
| 2292 | + template<class T> |
| 2293 | + T atomic_fetch_min_explicit(atomic<T>*, // freestanding |
| 2294 | + typename atomic<T>::value_type, |
| 2295 | + memory_order) noexcept; |
2269 | 2296 | template<class T>
|
2270 | 2297 | void atomic_wait(const volatile atomic<T>*, // freestanding
|
2271 | 2298 | typename atomic<T>::value_type) noexcept;
|
|
3289 | 3316 | memory_order = memory_order::seq_cst) const noexcept;
|
3290 | 3317 | @\placeholdernc{integral-type}@ fetch_xor(@\placeholdernc{integral-type}@,
|
3291 | 3318 | memory_order = memory_order::seq_cst) const noexcept;
|
| 3319 | + @\placeholdernc{integral-type}@ fetch_max(@\placeholdernc{integral-type}@, |
| 3320 | + memory_order = memory_order::seq_cst) const noexcept; |
| 3321 | + @\placeholdernc{integral-type}@ fetch_min(@\placeholdernc{integral-type}@, |
| 3322 | + memory_order = memory_order::seq_cst) const noexcept; |
3292 | 3323 |
|
3293 | 3324 | @\placeholdernc{integral-type}@ operator++(int) const noexcept;
|
3294 | 3325 | @\placeholdernc{integral-type}@ operator--(int) const noexcept;
|
|
3318 | 3349 |
|
3319 | 3350 | \indexlibrarymember{fetch_add}{atomic_ref<\placeholder{integral-type}>}%
|
3320 | 3351 | \indexlibrarymember{fetch_and}{atomic_ref<\placeholder{integral-type}>}%
|
| 3352 | +\indexlibrarymember{fetch_max}{atomic_ref<\placeholder{integral-type}>}% |
| 3353 | +\indexlibrarymember{fetch_min}{atomic_ref<\placeholder{integral-type}>}% |
3321 | 3354 | \indexlibrarymember{fetch_or}{atomic_ref<\placeholder{integral-type}>}%
|
3322 | 3355 | \indexlibrarymember{fetch_sub}{atomic_ref<\placeholder{integral-type}>}%
|
3323 | 3356 | \indexlibrarymember{fetch_xor}{atomic_ref<\placeholder{integral-type}>}%
|
|
3343 | 3376 | \pnum
|
3344 | 3377 | \indextext{signed integer representation!two's complement}%
|
3345 | 3378 | \remarks
|
3346 |
| -For signed integer types, |
| 3379 | +Except for \tcode{fetch_max} and \tcode{fetch_min}, for signed integer types |
3347 | 3380 | the result is as if the object value and parameters
|
3348 | 3381 | were converted to their corresponding unsigned types,
|
3349 | 3382 | the computation performed on those types, and
|
3350 | 3383 | the result converted back to the signed type.
|
3351 | 3384 | \begin{note}
|
3352 | 3385 | There are no undefined results arising from the computation.
|
3353 | 3386 | \end{note}
|
| 3387 | + |
| 3388 | +\pnum |
| 3389 | +For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum |
| 3390 | +computation is performed as if by \tcode{max} and \tcode{min} algorithms |
| 3391 | +\iref{alg.min.max}, respectively, with the object value and the first |
| 3392 | +parameter as the arguments. |
3354 | 3393 | \end{itemdescr}
|
3355 | 3394 |
|
3356 | 3395 | \indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}%
|
|
3522 | 3561 |
|
3523 | 3562 | T* fetch_add(difference_type, memory_order = memory_order::seq_cst) const noexcept;
|
3524 | 3563 | T* fetch_sub(difference_type, memory_order = memory_order::seq_cst) const noexcept;
|
| 3564 | + T* fetch_max(T*, memory_order = memory_order::seq_cst) const noexcept; |
| 3565 | + T* fetch_min(T*, memory_order = memory_order::seq_cst) const noexcept; |
3525 | 3566 |
|
3526 | 3567 | T* operator++(int) const noexcept;
|
3527 | 3568 | T* operator--(int) const noexcept;
|
|
3548 | 3589 |
|
3549 | 3590 | \indexlibrarymember{fetch_add}{atomic_ref<T*>}%
|
3550 | 3591 | \indexlibrarymember{fetch_sub}{atomic_ref<T*>}%
|
| 3592 | +\indexlibrarymember{fetch_max}{atomic_ref<T*>}% |
| 3593 | +\indexlibrarymember{fetch_min}{atomic_ref<T*>}% |
3551 | 3594 | \begin{itemdecl}
|
3552 | 3595 | T* fetch_@\placeholdernc{key}@(difference_type operand, memory_order order = memory_order::seq_cst) const noexcept;
|
3553 | 3596 | \end{itemdecl}
|
|
3574 | 3617 | \remarks
|
3575 | 3618 | The result may be an undefined address,
|
3576 | 3619 | but the operations otherwise have no undefined behavior.
|
| 3620 | + |
| 3621 | +\pnum |
| 3622 | +For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum |
| 3623 | +computation is performed as if by \tcode{max} and \tcode{min} |
| 3624 | +algorithms\iref{alg.min.max}, respectively, with the object value and the first |
| 3625 | +parameter as the arguments. |
| 3626 | + |
| 3627 | +\begin{note} |
| 3628 | +If the pointers point to different complete objects (or subobjects thereof), |
| 3629 | +the \tcode{<} operator does not establish a strict weak ordering |
| 3630 | +(\tref{cpp17.lessthancomparable}, \ref{expr.rel}). |
| 3631 | +\end{note} |
3577 | 3632 | \end{itemdescr}
|
3578 | 3633 |
|
| 3634 | + |
| 3635 | + |
3579 | 3636 | \indexlibrarymember{operator+=}{atomic_ref<T*>}%
|
3580 | 3637 | \indexlibrarymember{operator-=}{atomic_ref<T*>}%
|
3581 | 3638 | \begin{itemdecl}
|
|
4301 | 4358 | memory_order = memory_order::seq_cst) volatile noexcept;
|
4302 | 4359 | @\placeholdernc{integral-type}@ fetch_xor(@\placeholdernc{integral-type}@,
|
4303 | 4360 | memory_order = memory_order::seq_cst) noexcept;
|
| 4361 | + @\placeholdernc{integral-type}@ fetch_max( @\placeholdernc{integral-type}@, |
| 4362 | + memory_order = memory_order::seq_cst) volatile noexcept; |
| 4363 | + @\placeholdernc{integral-type}@ fetch_max( @\placeholdernc{integral-type}@, |
| 4364 | + memory_order = memory_order::seq_cst) noexcept; |
| 4365 | + @\placeholdernc{integral-type}@ fetch_min( @\placeholdernc{integral-type}@, |
| 4366 | + memory_order = memory_order::seq_cst) volatile noexcept; |
| 4367 | + @\placeholdernc{integral-type}@ fetch_min( @\placeholdernc{integral-type}@, |
| 4368 | + memory_order = memory_order::seq_cst) noexcept; |
4304 | 4369 |
|
4305 | 4370 | @\placeholdernc{integral-type}@ operator++(int) volatile noexcept;
|
4306 | 4371 | @\placeholdernc{integral-type}@ operator++(int) noexcept;
|
|
4357 | 4422 | \tcode{add} &
|
4358 | 4423 | \tcode{+} &
|
4359 | 4424 | addition &
|
| 4425 | +\tcode{and} & |
| 4426 | + \tcode{\&} & |
| 4427 | + bitwise and \\ |
4360 | 4428 | \tcode{sub} &
|
4361 | 4429 | \tcode{-} &
|
4362 |
| - subtraction \\ |
| 4430 | + subtraction & |
4363 | 4431 | \tcode{or} &
|
4364 | 4432 | \tcode{|} &
|
4365 |
| - bitwise inclusive or & |
| 4433 | + bitwise inclusive or \\ |
| 4434 | +\tcode{max} & |
| 4435 | + & |
| 4436 | + maximum & |
4366 | 4437 | \tcode{xor} &
|
4367 | 4438 | \tcode{\caret} &
|
4368 | 4439 | bitwise exclusive or \\
|
4369 |
| -\tcode{and} & |
4370 |
| - \tcode{\&} & |
4371 |
| - bitwise and &&&\\ |
| 4440 | +\tcode{min} & |
| 4441 | + & |
| 4442 | + minimum &&&\\ |
4372 | 4443 | \end{floattable}
|
4373 | 4444 |
|
4374 | 4445 | \indexlibraryglobal{atomic_fetch_add}%
|
4375 | 4446 | \indexlibraryglobal{atomic_fetch_and}%
|
| 4447 | +\indexlibraryglobal{atomic_fetch_max}% |
| 4448 | +\indexlibraryglobal{atomic_fetch_min}% |
4376 | 4449 | \indexlibraryglobal{atomic_fetch_or}%
|
4377 | 4450 | \indexlibraryglobal{atomic_fetch_sub}%
|
4378 | 4451 | \indexlibraryglobal{atomic_fetch_xor}%
|
4379 | 4452 | \indexlibraryglobal{atomic_fetch_add_explicit}%
|
4380 | 4453 | \indexlibraryglobal{atomic_fetch_and_explicit}%
|
| 4454 | +\indexlibraryglobal{atomic_fetch_max_explicit}% |
| 4455 | +\indexlibraryglobal{atomic_fetch_min_explicit}% |
4381 | 4456 | \indexlibraryglobal{atomic_fetch_or_explicit}%
|
4382 | 4457 | \indexlibraryglobal{atomic_fetch_sub_explicit}%
|
4383 | 4458 | \indexlibraryglobal{atomic_fetch_xor_explicit}%
|
4384 | 4459 | \indexlibrarymember{fetch_add}{atomic<\placeholder{integral-type}>}%
|
4385 | 4460 | \indexlibrarymember{fetch_and}{atomic<\placeholder{integral-type}>}%
|
| 4461 | +\indexlibrarymember{fetch_max}{atomic<\placeholder{integral-type}>}% |
| 4462 | +\indexlibrarymember{fetch_min}{atomic<\placeholder{integral-type}>}% |
4386 | 4463 | \indexlibrarymember{fetch_or}{atomic<\placeholder{integral-type}>}%
|
4387 | 4464 | \indexlibrarymember{fetch_sub}{atomic<\placeholder{integral-type}>}%
|
4388 | 4465 | \indexlibrarymember{fetch_xor}{atomic<\placeholder{integral-type}>}%
|
|
4412 | 4489 | \pnum
|
4413 | 4490 | \indextext{signed integer representation!two's complement}%
|
4414 | 4491 | \remarks
|
4415 |
| -For signed integer types, |
| 4492 | +Except for \tcode{fetch_max} and \tcode{fetch_min}, for signed integer types |
4416 | 4493 | the result is as if the object value and parameters
|
4417 | 4494 | were converted to their corresponding unsigned types,
|
4418 | 4495 | the computation performed on those types, and
|
|
4421 | 4498 | There are no undefined results arising from the computation.
|
4422 | 4499 | \end{note}
|
4423 | 4500 |
|
| 4501 | +\pnum |
| 4502 | +For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum |
| 4503 | +computation is performed as if by \tcode{max} and \tcode{min} algorithms |
| 4504 | +\iref{alg.min.max}, respectively, with the object value and the first parameter |
| 4505 | +as the arguments. |
4424 | 4506 | \end{itemdescr}
|
4425 | 4507 |
|
4426 | 4508 | \indexlibrarymember{operator+=}{atomic<T*>}%
|
|
4659 | 4741 | T* fetch_add(ptrdiff_t, memory_order = memory_order::seq_cst) noexcept;
|
4660 | 4742 | T* fetch_sub(ptrdiff_t, memory_order = memory_order::seq_cst) volatile noexcept;
|
4661 | 4743 | T* fetch_sub(ptrdiff_t, memory_order = memory_order::seq_cst) noexcept;
|
| 4744 | + T* fetch_max(T*, memory_order = memory_order::seq_cst) volatile noexcept; |
| 4745 | + T* fetch_max(T*, memory_order = memory_order::seq_cst) noexcept; |
| 4746 | + T* fetch_min(T*, memory_order = memory_order::seq_cst) volatile noexcept; |
| 4747 | + T* fetch_min(T*, memory_order = memory_order::seq_cst) noexcept; |
4662 | 4748 |
|
4663 | 4749 | T* operator++(int) volatile noexcept;
|
4664 | 4750 | T* operator++(int) noexcept;
|
|
4712 | 4798 | \tcode{sub} &
|
4713 | 4799 | \tcode{-} &
|
4714 | 4800 | subtraction \\
|
| 4801 | +\tcode{max} & |
| 4802 | + & |
| 4803 | + maximum & |
| 4804 | +\tcode{min} & |
| 4805 | + & |
| 4806 | + minimum \\ |
4715 | 4807 | \end{floattable}
|
4716 | 4808 |
|
4717 | 4809 | \indexlibraryglobal{atomic_fetch_add}%
|
| 4810 | +\indexlibraryglobal{atomic_fetch_max}% |
| 4811 | +\indexlibraryglobal{atomic_fetch_min}% |
4718 | 4812 | \indexlibraryglobal{atomic_fetch_sub}%
|
4719 | 4813 | \indexlibraryglobal{atomic_fetch_add_explicit}%
|
| 4814 | +\indexlibraryglobal{atomic_fetch_max_explicit}% |
| 4815 | +\indexlibraryglobal{atomic_fetch_min_explicit}% |
4720 | 4816 | \indexlibraryglobal{atomic_fetch_sub_explicit}%
|
4721 | 4817 | \indexlibrarymember{fetch_add}{atomic<T*>}%
|
| 4818 | +\indexlibrarymember{fetch_max}{atomic<T*>}% |
| 4819 | +\indexlibrarymember{fetch_min}{atomic<T*>}% |
4722 | 4820 | \indexlibrarymember{fetch_sub}{atomic<T*>}%
|
4723 | 4821 | \begin{itemdecl}
|
4724 | 4822 | T* fetch_@\placeholdernc{key}@(ptrdiff_t operand, memory_order order = memory_order::seq_cst) volatile noexcept;
|
|
4754 | 4852 | \remarks
|
4755 | 4853 | The result may be an undefined address,
|
4756 | 4854 | but the operations otherwise have no undefined behavior.
|
| 4855 | + |
| 4856 | +\pnum |
| 4857 | +For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum |
| 4858 | +computation is performed as if by \tcode{max} and \tcode{min} |
| 4859 | +algorithms\iref{alg.min.max}, respectively, with the object value and the first |
| 4860 | +parameter as the arguments. |
| 4861 | + |
| 4862 | +\begin{note} |
| 4863 | +If the pointers point to different complete objects (or subobjects thereof), |
| 4864 | +the \tcode{<} operator does not establish a strict weak ordering |
| 4865 | +(\tref{cpp17.lessthancomparable}, \ref{expr.rel}). |
| 4866 | +\end{note} |
4757 | 4867 | \end{itemdescr}
|
4758 | 4868 |
|
4759 | 4869 | \indexlibrarymember{operator+=}{atomic<T*>}%
|
|
0 commit comments