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

Function main

Examples/Modules/Chapter 16/Ex16_07D/Ex16_07D.cpp:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12std::vector<double> computeValues(size_t howMany); // A function to compute an array of values
13
14int main()
15{
16 try
17 {
18 auto values{ computeValues(10'000) }; // Cannot leak either: resource is managed by RAII object!
19 }
20 catch (const Trouble&)
21 {
22 std::cout << "No worries: I've caught it!" << std::endl;
23 }
24}
25
26std::vector<double> computeValues(size_t howMany)
27{

Callers

nothing calls this directly

Calls 1

computeValuesFunction · 0.70

Tested by

no test coverage detected