Namespaces
Variants
Actions

swap(std::mdspan)

From cppreference.com
< cpp‎ | container‎ | mdspan
 
C++
 
Containers library
 
std::mdspan
friend constexpr void swap( mdspan& x, mdspan& y ) noexcept;
(since C++23)

Overloads the std::swap algorithm for std::mdspan. Exchanges the state of x with that of y. Equivalent to:

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

This function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::mdspan is an associated class of the arguments.

Contents

[edit] Parameters

x, y - mdspan objects whose states to swap

[edit] Return value

(none)

[edit] Example

[edit] See also

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant