Browse Source
ring_buffer: Use std::atomic_size_t in a static assert
Avoids the need to repeat "std::" twice
pull/15/merge
Lioncash
7 years ago
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
1 changed files with
1 additions and
1 deletions
-
src/common/ring_buffer.h
|
|
@ -30,7 +30,7 @@ class RingBuffer { |
|
|
static_assert(capacity < std::numeric_limits<std::size_t>::max() / 2 / granularity); |
|
|
static_assert(capacity < std::numeric_limits<std::size_t>::max() / 2 / granularity); |
|
|
static_assert((capacity & (capacity - 1)) == 0, "capacity must be a power of two"); |
|
|
static_assert((capacity & (capacity - 1)) == 0, "capacity must be a power of two"); |
|
|
// Ensure lock-free. |
|
|
// Ensure lock-free. |
|
|
static_assert(std::atomic<std::size_t>::is_always_lock_free); |
|
|
|
|
|
|
|
|
static_assert(std::atomic_size_t::is_always_lock_free); |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
/// Pushes slots into the ring buffer |
|
|
/// Pushes slots into the ring buffer |
|
|
|