Skip to content
Snippets Groups Projects
Unverified Commit ab6dfa4f authored by Lioncash's avatar Lioncash
Browse files

ring_buffer: Use std::atomic_size_t in a static assert

Avoids the need to repeat "std::" twice
parent c51f8563
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ class RingBuffer { ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment