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

Function swap

Exercises/Modules/Chapter 11/Soln11_03/words.sorting.cpp:4–9  ·  view source on GitHub ↗

Additional helpers for word::sort(Words&) */

Source from the content-addressed store, hash-verified

2
3/* Additional helpers for word::sort(Words&) */
4void swap(words::Words& words, size_t first, size_t second)
5{
6 auto temp{ words[first] };
7 words[first] = words[second];
8 words[second] = temp;
9}
10
11void sort(words::Words& words, size_t start, size_t end);
12

Callers 1

sortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected