Remove dumb overloads of atomic_op, fetch_op

And lf_queue::apply.
Fix inlining problem by passing F by value.
This commit is contained in:
Nekotekina 2019-08-07 03:56:47 +03:00
parent cf16ee5eb5
commit 4f22559ff0
3 changed files with 28 additions and 104 deletions

View file

@ -388,27 +388,13 @@ public:
// Apply func(data) to each element, return the total length
template <typename F>
std::size_t apply(F&& func)
std::size_t apply(F func)
{
std::size_t count = 0;
for (auto slice = pop_all(); slice; slice.pop_front())
{
std::invoke(std::forward<F>(func), *slice);
}
return count;
}
// apply() overload for callable template argument
template <auto F>
std::size_t apply()
{
std::size_t count = 0;
for (auto slice = pop_all(); slice; slice.pop_front())
{
std::invoke(F, *slice);
std::invoke(func, *slice);
}
return count;