std::experi...agate_const)(3)
β¨ NAME β¨
okay so this page is from the C++ Standard Library manual (the header literally says βC++ Standard Libaryβ β typo is canon, not me π), and itβs all about std::experimental::swap(std::experimental::propagate_const).
The name is std::experimental::swap(std::experimental::propagate_const) β yes, itβs the std::experimental::swap(std::experimental::propagate_const) page, no cap. Weβre literally swapping propagate_const besties. π
πΈ SYNOPSIS πΈ
The man page tags this synopsis as (library fundamentals TS v2), and the signature is:
template< class T >
constexpr void swap( std::experimental::propagate_const<T>& lhs,
std::experimental::propagate_const<T>& rhs ) noexcept(/* see below */);
So this specializes the swap algorithm for std::experimental::propagate_const. It swaps the pointers of lhs and rhs. Equivalent to lhs.swap(rhs). π
glow-up note: in library fundamentals TS v3, this overload participates in overload resolution only ifstd::is_swappable_v<T>is true. (Yes,std::is_swappable_v<T>β keep that exact spelling, bestie. π«Ά)
π PARAMETERS π
lhs,rhsβ thepropagate_consts whose contents to swap. Thatβs the whole assignment. iconic.
π¦ RETURN VALUE π¦
none β literally (none). Nothing comes back. Slay.
π EXCEPTIONS π
The noexcept specification is:
noexcept(noexcept(lhs.swap(rhs)))
So itβs conditionally noexcept, and the vibes are very βdepends on lhs.swap(rhs).β π
π₯ COMPLEXITY π₯
Constant. O(1) energy, periodt.
π SEE ALSO π
swapβ swaps the values of two objects (function template)swapβ swaps the wrapped pointer (public member function)
π CATEGORY π
* conditionally noexcept
made with π from cppreference.com, version/date 2024.06.10, and the footer is still giving truncated std::experi...agate_const)(3) main-character energy. bye bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms