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:
parent
ff453b06f9
commit
262520fcfe
2 changed files with 72 additions and 67 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue