26 #include <spdlog/spdlog.h>
37 template <
typename T,
size_t Size>
44 if (!tail_.is_lock_free()) {
46 "Your platform does not support std::atomic_size_t as lock-free "
59 auto next_tail = increment(tail);
60 if (next_tail != head_) {
75 const size_t head = head_;
80 head_ = increment(head);
85 bool empty() {
return head_ == tail_; }
97 size_t increment(
size_t idx)
const {
return (idx + 1) %
Capacity; }
103 std::atomic_size_t head_;
106 std::atomic_size_t tail_;