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

Function swap

Exercises/NoModules/Chapter 10/Soln10_06.cpp:40–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39template <typename T>
40void swap(std::vector<T>& data, size_t first, size_t second)
41{
42 auto temp{data[first]};
43 data[first] = data[second];
44 data[second] = temp;
45}
46
47// Sort data in ascending sequence
48template <typename T>

Callers 1

sortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected