std::experi...::function)(3)
π std::experimental::swap(std::experimental::function) π
okay so bestie, this is a page straight out of the C++ Standard Libary (their spelling, not mine, don't come for me π) and it's about one very specific little swap. Let's get into it.
πΈ NAME πΈ
std::experimental::swap(std::experimental::function) β literally just std::experimental::swap(std::experimental::function) again, that's the whole name, no notes π
β¨ Synopsis β¨
Here's the signature, copy it exactly bestie, character for character:
template< class R, class... Args >
void swap( std::experimental::function<R(Args...)> &lhs,
std::experimental::function<R(Args...)> &rhs );
So what is this? It overloads the swap algorithm for std::experimental::function. It exchanges the state of lhs with that of rhs β and the way it does that is, effectively, it just calls lhs.swap(rhs). That's it. That's the whole vibe π«Ά
π Parameters π
lhs,rhsβ polymorphic function wrappers whose states to swap. yeah. both of them. the states get swapped. iconic behaviour honestly π
π Return value π
(none) β nothing, nada, zero, it just does the thing and dips π
π₯ Exceptions π₯
May throw implementation-defined exceptions. so like, it might throw, but which ones is between your implementation and the compiler, iykyk π
π¦ Example π¦
This section is incomplete Reason: no example
ππ no example bestie, they really left us hanging. (The category section is out here doing a whole "Todo: no example" callout about it, so at least we're not alone in our grief.)
β See also β
swapβ swaps the contents (public member function)
and that's the page!! short and sweet, main character energy for a swap overload fr fr πΈπ
sign-off time π this little cutie came fromhttp://cppreference.com, dated2024.06.10, and the header/footer both saystd::experi...::function)(3)because the title got truncated and honestly? relatable. stay slaying, 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