Skip to content

Commit

Permalink
Enable enqueue_bulk and it's variants to take iterator references
Browse files Browse the repository at this point in the history
  • Loading branch information
koraa committed Apr 5, 2016
1 parent d32bd47 commit 95a00a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions concurrentqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ class ConcurrentQueue
bool enqueue_bulk(It itemFirst, size_t count)
{
if (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false;
return inner_enqueue_bulk<CanAlloc>(std::forward<It>(itemFirst), count);
return inner_enqueue_bulk<CanAlloc, It>(std::forward<It>(itemFirst), count);
}

// Enqueues several items using an explicit producer token.
Expand All @@ -955,7 +955,7 @@ class ConcurrentQueue
template<typename It>
bool enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count)
{
return inner_enqueue_bulk<CanAlloc>(token, std::forward<It>(itemFirst), count);
return inner_enqueue_bulk<CanAlloc, It>(token, std::forward<It>(itemFirst), count);
}

// Enqueues a single item (by copying it).
Expand Down Expand Up @@ -1007,7 +1007,7 @@ class ConcurrentQueue
bool try_enqueue_bulk(It itemFirst, size_t count)
{
if (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false;
return inner_enqueue_bulk<CannotAlloc>(std::forward<It>(itemFirst), count);
return inner_enqueue_bulk<CannotAlloc, It>(std::forward<It>(itemFirst), count);
}

// Enqueues several items using an explicit producer token.
Expand All @@ -1018,7 +1018,7 @@ class ConcurrentQueue
template<typename It>
bool try_enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count)
{
return inner_enqueue_bulk<CannotAlloc>(token, std::forward<It>(itemFirst), count);
return inner_enqueue_bulk<CannotAlloc, It>(token, std::forward<It>(itemFirst), count);
}


Expand Down Expand Up @@ -1282,14 +1282,14 @@ class ConcurrentQueue
template<AllocationMode canAlloc, typename It>
inline bool inner_enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count)
{
return static_cast<ExplicitProducer*>(token.producer)->ConcurrentQueue::ExplicitProducer::template enqueue_bulk<canAlloc>(std::forward<It>(itemFirst), count);
return static_cast<ExplicitProducer*>(token.producer)->ConcurrentQueue::ExplicitProducer::template enqueue_bulk<canAlloc, It>(std::forward<It>(itemFirst), count);
}

template<AllocationMode canAlloc, typename It>
inline bool inner_enqueue_bulk(It itemFirst, size_t count)
{
auto producer = get_or_add_implicit_producer();
return producer == nullptr ? false : producer->ConcurrentQueue::ImplicitProducer::template enqueue_bulk<canAlloc>(std::forward<It>(itemFirst), count);
return producer == nullptr ? false : producer->ConcurrentQueue::ImplicitProducer::template enqueue_bulk<canAlloc, It>(std::forward<It>(itemFirst), count);
}

inline bool update_current_producer_after_rotation(consumer_token_t& token)
Expand Down

0 comments on commit 95a00a3

Please sign in to comment.