23 std::vector<std::unique_ptr<T>>
Nodes;
26 template <
class U> U *
add(std::unique_ptr<U> Node) {
27 Nodes.push_back(std::move(Node));
28 return dynamic_cast<U *
>(
Nodes.back().get());
35 template <
class U> U *
record(U *Node) {
36 Nodes.emplace_back(std::unique_ptr<U>(Node));
Access EvalCache in nix::EvalState.
A simple pointer pool, a vector of unique_ptrs.
std::vector< std::unique_ptr< T > > Nodes
U * add(std::unique_ptr< U > Node)
Takes ownership of a node, add it to the pool.
U * record(U *Node)
Takes ownership from a raw pointer.