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

Function main

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

Source from the content-addressed store, hash-verified

12}
13
14int main()
15{
16 Array<std::string> strings { 123 };
17 strings = buildStringArray(1'000); // Assign an rvalue to strings
18
19 Array<std::string> more_strings{ 2'000 };
20 strings = std::move(more_strings); // Move more_strings into strings
21
22 /* Caution: once moved, an object should not be used anymore! */
23// std::cout << more_strings[101] << std::endl; // ???
24}

Callers

nothing calls this directly

Calls 1

buildStringArrayFunction · 0.70

Tested by

no test coverage detected