MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / Keeper

Class Keeper

11.04-rangeBasedForLoopWithTemporary0/main.cpp:8–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6# include <vector>
7
8class Keeper { // #A
9 std::vector<int> data{2, 3, 4};
10
11public:
12 ~Keeper() { std::cout << "dtor\n"; }
13
14 // #B Returns by reference
15 auto& items() { return data; }
16};
17
18Keeper GetKeeper() // #C Returns by value
19{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected