Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
39
template <typename T>
40
void 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
48
template <typename T>
Callers
1
sort
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected