Skip to content

Commit abbc992

Browse files
committed
const std::function()&s
1 parent 607733d commit abbc992

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/circular_queue/circular_queue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class circular_queue
177177
@brief Iterate over and remove each available element from queue,
178178
calling back fun with an rvalue reference of every single element.
179179
*/
180-
void for_each(std::function<void(T&&)> fun);
180+
void for_each(const std::function<void(T&&)>& fun);
181181

182182
/*!
183183
@brief In reverse order, iterate over, pop and optionally requeue each available element from the queue,
@@ -291,7 +291,7 @@ size_t circular_queue<T>::pop_n(T* buffer, size_t size) {
291291
}
292292

293293
template< typename T >
294-
void circular_queue<T>::for_each(std::function<void(T&&)> fun)
294+
void circular_queue<T>::for_each(const std::function<void(T&&)>& fun)
295295
{
296296
auto outPos = m_outPos.load(std::memory_order_acquire);
297297
const auto inPos = m_inPos.load(std::memory_order_relaxed);

0 commit comments

Comments
 (0)