std::mdspan::operator=(3)

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

πŸ’… NAME πŸ’…

std::mdspan::operator= β€” that's the whole name, icon, no notes. It's the assignment operator for std::mdspan, and yes bestie the manpage literally just repeats the name back at you twice 🫢


πŸ¦‹ Synopsis πŸ¦‹

ok so first thing, it's Defined in header <mdspan> ✨

Here's overload (1), a constexpr one, and it's marked since C++23 πŸ‘‘:

constexpr mdspan& operator=( const mdspan& rhs ) = default;

And here's overload (2), also constexpr, also since C++23 🌸:

constexpr mdspan& operator=( mdspan&& rhs ) = default;

So what's actually happening? It Assigns rhs to *this with:

  1. defaulted copy assignment operator,
  2. defaulted move assignment operator.

That's it. That's the whole vibe β€” both of them are = default, so the compiler is doing the work, not us πŸ’€


πŸŽ€ Parameters πŸŽ€

  • other β€” another mdspan to copy or move from

(and yeah, the synopsis up there calls the same thing rhs while this section calls it other β€” that's just how the page is written, iykyk πŸ™ˆ)


🌈 Return value 🌈

*this β€” that's it, that's the return, it hands you back yourself πŸ’–


πŸ“ Example πŸ“

This section is incomplete Reason: no example

😭 literally nothing to show you bestie, they left it blank. Not me wanting a cute little example here... but nope, moving on.


🧚 See also 🧚

This section is incomplete

also empty 😭 the whole back half of this page is under construction fr fr


⭐ Categories ⭐

  • Todo no example
  • Todo without reason

and that's the page, bestie! source is http://cppreference.com, version date 2024.06.10, and the whole thing is filed under std::mdspan::operator=(3) β€” mwah, go assign something πŸ’œπŸŽ€

πŸ“¦ where this page comes from