std::swap(std::mdspan)(3)

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

πŸ’– NAME πŸ’–

okay so bestie, welcome to std::swap(std::mdspan)(3) from the C++ Standard Libary (yes, that spelling is straight from the header, don’t come for me πŸ’€). The name is literally std::swap(std::mdspan) - std::swap(std::mdspan). Iconic. No notes. ✨


✨ Synopsis ✨

Defined in header <mdspan>:

friend constexpr void swap( mdspan& x, mdspan& y ) noexcept;

(since C++23) β€” okay so this is the friend function that overloads the std::swap algorithm for std::mdspan. It exchanges the state of x with that of y. Slay. πŸ’…

Given ptr_, map_, and acc_ as exposition-only data members, it’s equivalent to:

std::swap(x.ptr_, y.ptr_);
std::swap(x.map_, y.map_);
std::swap(x.acc_, y.acc_);

πŸŽ€ Parameters πŸŽ€

  • x, y - mdspan objects whose states to swap

πŸ’… Return value πŸ’…

(none). Literally none. No return value, no drama. periodt. 🫢


πŸ¦‹ Example πŸ¦‹

This section is incomplete Reason: no example

😭 no example yet, but the reason is literally β€œno example.” Respect the honesty. πŸ“


🌈 See also 🌈

This section is incomplete. The see-also list is still cooking 🧚


🏷️ Categories: 🏷️

  • Todo no example
  • Todo without reason

mwah πŸ’‹ this was std::swap(std::mdspan)(3) β€” source/version: http://cppreference.com, date: 2024.06.10. bye bestie, go swap those mdspans πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from