std::experi...ckaged_task)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… std::experimental::swap(std::experimental::packaged_task) β€” the NAME section, bestie

okay so this page lives in the C++ Standard Libary manual (yes that's how it's spelled, don't come for me πŸ’€), and the star of the show is std::experimental::swap(std::experimental::packaged_task). Say that five times fast. Or like, once. It's a mouthful. 🫢


✨ Synopsis ✨

Here's the whole vibe, written out exactly:

template< class R, class... Args >

void swap( std::experimental::packaged_task<R(Args...)> &lhs,

           std::experimental::packaged_task<R(Args...)> &rhs )
noexcept;

So what's it doing? It overloads the swap algorithm for std::experimental::packaged_task. It exchanges the state of lhs with that of rhs. And the way it does that? Bestie, it effectively calls lhs.swap(rhs) β€” like, that's literally the whole implementation, no cap. ✨

Also note it's noexcept, so it's giving calm, unbothered, no-throw main character energy. πŸ’…


πŸŽ€ Parameters πŸŽ€

  • lhs, rhs β€” packaged_tasks whose states to swap. That's it. That's the list. Two little guys trading states. πŸ¦‹

🌸 Return value 🌸

(none) β€” nothing, nada, zero. It hands you back absolutely nothing and honestly? Respect. 😌


πŸ“ Example πŸ“

This section is incomplete Reason: no example

screaming crying throwing up 😭 the example section is EMPTY. no example. none. we got nothing. the docs said "figure it out yourself bestie" πŸ™ˆ


πŸ‘‘ See also πŸ‘‘

  • swap β€” swaps two task objects (public member function of std::packaged_task<R(Args...)>). the icon itself, the original, the blueprint. πŸ”₯

⭐ Category ⭐

  • Todo no example

(yep, the todo is immortalized in the category list. it's canon now. πŸ’€)


anyway that's the whole page, bestie β€” go swap some packaged tasks, you're gonna slay πŸ’œ

source: http://cppreference.com Β· version/date: 2024.06.10 Β· mwah, catch you in the next manpage πŸŽ€

πŸ“¦ where this page comes from