MCPcopy Create free account
hub / github.com/anthonywilliams/ccia_code_samples / push

Method push

listings/listing_6.4.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 void push(T new_value)
44 {
45 std::unique_ptr<node> p(new node(std::move(new_value)));
46 node* const new_tail=p.get();
47 if(tail)
48 {
49 tail->next=std::move(p);
50 }
51 else
52 {
53 head=std::move(p);
54 }
55 tail=new_tail;
56 }
57};
58

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected