Skip to content

Commit

Permalink
Update MPMCQueue.h to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
charliehuge authored Jan 17, 2025
1 parent 7d4f178 commit 6ea3e70
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions third_party/rigtorp/MPMCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ template <typename T, typename Allocator = AlignedAllocator<Slot<T>>>
class Queue {
private:
static_assert(std::is_nothrow_copy_assignable<T>::value ||
std::is_nothrow_move_assignable<T>::value,
std::is_nothrow_move_assignable<T>::value,
"T must be nothrow copy or move assignable");

static_assert(std::is_nothrow_destructible<T>::value,
Expand Down Expand Up @@ -148,7 +148,7 @@ class Queue {
"prevent false sharing between adjacent queues");
static_assert(
offsetof(Queue, tail_) - offsetof(Queue, head_) ==
static_cast<std::ptrdiff_t>(hardwareInterferenceSize),
static_cast<std::ptrdiff_t>(hardwareInterferenceSize),
"head and tail must be a cache line apart to prevent false sharing");
}

Expand Down Expand Up @@ -203,8 +203,8 @@ class Queue {
}

template <typename P,
typename = typename std::enable_if<
std::is_nothrow_constructible<T, P &&>::value>::type>
typename = typename std::enable_if<
std::is_nothrow_constructible<T, P &&>::value>::type>
void push(P &&v) noexcept {
emplace(std::forward<P>(v));
}
Expand All @@ -216,8 +216,8 @@ class Queue {
}

template <typename P,
typename = typename std::enable_if<
std::is_nothrow_constructible<T, P &&>::value>::type>
typename = typename std::enable_if<
std::is_nothrow_constructible<T, P &&>::value>::type>
bool try_push(P &&v) noexcept {
return try_emplace(std::forward<P>(v));
}
Expand Down Expand Up @@ -289,7 +289,7 @@ class Queue {
} // namespace mpmc

template <typename T,
typename Allocator = mpmc::AlignedAllocator<mpmc::Slot<T>>>
typename Allocator = mpmc::AlignedAllocator<mpmc::Slot<T>>>
using MPMCQueue = mpmc::Queue<T, Allocator>;

} // namespace rigtorp

0 comments on commit 6ea3e70

Please sign in to comment.