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:
parent
09b14ea97a
commit
eab934cb2a
3 changed files with 115 additions and 111 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue