MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / swap

Function swap

Examples/NoModules/Chapter 18/Ex18_05B/Array.h:121–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119// Swap non-member function template (optional)
120template <typename T>
121void swap(Array<T>& one, Array<T>& other) noexcept
122{
123 one.swap(other); // Forward to public member function
124}
125
126// push_back() overload for lvalue references
127template <typename T>

Callers 3

Array.hFile · 0.70
swapMethod · 0.70
push_backMethod · 0.70

Calls 1

swapMethod · 0.45

Tested by

no test coverage detected