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

Function swap

Examples/NoModules/Chapter 21/Ex21_03/Array.h:117–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115// Swap non-member function template (optional)
116template <typename T> requires std::default_initializable<T> && std::destructible<T>
117void swap(Array<T>& one, Array<T>& other) noexcept
118{
119 one.swap(other); // Forward to public member function
120}
121
122// push_back() overload for lvalue references
123template <typename T> requires std::default_initializable<T> && std::destructible<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