1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Make the canReachRoots() traversal non-recursive

This commit is contained in:
Eelco Dolstra 2021-10-14 12:31:21 +02:00
parent 09b14ea97a
commit eab934cb2a
3 changed files with 115 additions and 111 deletions

View file

@ -523,6 +523,17 @@ std::optional<typename T::value_type> remove_begin(T & c)
}
/* Remove and return the first item from a container. */
template <class T>
std::optional<typename T::value_type> pop(T & c)
{
if (c.empty()) return {};
auto v = std::move(c.front());
c.pop();
return v;
}
template<typename T>
class Callback;