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

Use a thread per connection

This commit is contained in:
Eelco Dolstra 2021-08-20 11:18:35 +02:00
parent ff453b06f9
commit 262520fcfe
2 changed files with 72 additions and 67 deletions

View file

@ -511,6 +511,18 @@ std::optional<typename T::mapped_type> get(const T & map, const typename T::key_
}
/* Remove and return the first item from a container. */
template <class T>
std::optional<typename T::value_type> remove_begin(T & c)
{
auto i = c.begin();
if (i == c.end()) return {};
auto v = std::move(*i);
c.erase(i);
return v;
}
template<typename T>
class Callback;