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

Function swap

Exercises/Modules/Chapter 11/Soln11_02/words.cpp:23–28  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

21
22/* Additional helpers for word::sort(Words&) */
23void swap(words::Words& words, size_t first, size_t second)
24{
25 auto temp{ words[first] };
26 words[first] = words[second];
27 words[second] = temp;
28}
29
30void sort(words::Words& words, size_t start, size_t end);
31

Callers 1

sortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected