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

Function main

Examples/NoModules/Chapter 21/Ex21_03/Ex21_03.cpp:8–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6static_assert(requires { typename Array<std::unique_ptr<int>>; });
7
8int main()
9{
10 Array<std::unique_ptr<int>> tenSmartPointers(10);
11 Array<std::unique_ptr<int>> target;
12 // target = tenSmartPointers; /* Constraint not satisfied: copyable<unique_ptr> */
13 target = std::move(tenSmartPointers);
14 target.push_back(std::make_unique<int>(123));
15}

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected