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

Function main

Examples/NoModules/Chapter 10/Ex10_03A.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14int main()
15{
16 const int small_int {10};
17 std::cout << "Larger of " << small_int << " and 9.6 is "
18 << larger(small_int, 9.6) << std::endl; // deduced return type: double
19
20 const std::string a_string {"A"};
21 std::cout << "Larger of \"" << a_string << "\" and \"Z\" is \""
22 << larger(a_string, "Z") << '"' << std::endl; // deduced return type: std::string
23
24 const std::vector v1{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
25 const std::vector v2{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 };
26 std::cout << "The larger of our two vectors ends with " << larger(v1, v2).back();
27}
28

Callers

nothing calls this directly

Calls 1

largerFunction · 0.70

Tested by

no test coverage detected