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

Function larger

Exercises/Modules/Chapter 10/Soln10_05.cpp:29–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27// Template for functions to return the larger of two values
28template <typename T>
29T larger(T a, T b)
30{
31 static size_t counter{};
32 std::cout << "This instantation has now been called " << ++counter << " time(s)\n";
33 return a > b? a : b;
34}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected