mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Simplify static_for_each_in
This commit is contained in:
parent
457a9dca00
commit
342d08ab1d
@ -48,6 +48,7 @@ void assert_async_completion(C&& continuable) {
|
||||
// Workaround for our known GCC bug.
|
||||
util::unused(std::forward<decltype(args)>(args)...);
|
||||
});
|
||||
|
||||
ASSERT_TRUE(*called);
|
||||
}
|
||||
|
||||
|
||||
@ -346,14 +346,9 @@ constexpr void static_for_each_in(Sequenceable&& sequenceable,
|
||||
Handler&& handler) {
|
||||
unpack(
|
||||
std::forward<Sequenceable>(sequenceable), [&](auto&&... entries) mutable {
|
||||
auto consume = [&](auto&& entry) mutable {
|
||||
handler(std::forward<decltype(entry)>(entry));
|
||||
return 0;
|
||||
};
|
||||
// Apply the consume function to every entry inside the pack
|
||||
auto deduce = {0, consume(std::forward<decltype(entries)>(entries))...};
|
||||
(void)deduce;
|
||||
(void)consume;
|
||||
std::initializer_list<int>{0,
|
||||
((void)handler(std::forward<decltype(entries)>(entries)), 0)...};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user