Difference between revisions of "cpp/container/mdspan/swap2"
From cppreference.com
m (fix links.) |
D41D8CD98F (Talk | contribs) (note that this is a hidden friend) |
||
Line 1: | Line 1: | ||
− | {{ | + | {{title|swap{{small|(std::mdspan)}}}} |
{{cpp/container/mdspan/navbar}} | {{cpp/container/mdspan/navbar}} | ||
− | {{ddcl | + | {{ddcl|since=c++23| |
friend constexpr void swap( mdspan& x, mdspan& y ) noexcept; | friend constexpr void swap( mdspan& x, mdspan& y ) noexcept; | ||
}} | }} | ||
Line 14: | Line 14: | ||
std::swap(x.acc_, y.acc_); | std::swap(x.acc_, y.acc_); | ||
}} | }} | ||
+ | |||
+ | {{cpp/hidden friend|std::mdspan}} | ||
===Parameters=== | ===Parameters=== |
Revision as of 08:49, 18 October 2024
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.
Given ptr_
, map_
, and acc_
as exposition-only data members, equivalent to:
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 |
Parameters
x, y | - | mdspan objects whose states to swap
|
Return value
(none)
Example
This section is incomplete Reason: no example |
See also
This section is incomplete |