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

Method swap

Exercises/Modules/Chapter 20/Soln20_01/Truckload.cpp:19–22  ·  view source on GitHub ↗

Swap assignment operator (noexcept)

Source from the content-addressed store, hash-verified

17
18// Swap assignment operator (noexcept)
19void Truckload::swap(Truckload& other) noexcept
20{
21 m_boxes.swap(other.m_boxes);
22}
23
24// Optional yet conventional non-member function (forwards to member function)
25void swap(Truckload& one, Truckload& other) noexcept

Callers 1

swapFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected