Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
target_compile_options(${target} PRIVATE
"$<$<CXX_COMPILER_ID:MSVC>:/permissive-;/W4;/wd4324;/w14242>"
"$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-Wall;-Wextra;-Wpedantic;-Wshadow;-Wconversion;-Wsign-conversion;-Wold-style-cast;-Wundef;-Wcast-align;-Wzero-as-null-pointer-constant;-Wformat=2>"
"$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,12>>:-Wno-interference-size>"
)
endfunction()

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ t2.join();
- `template <typename P> void push(P &&v);`

Enqueue an item using move construction. Participates in overload
resolution only if `std::is_nothrow_constructible<T, P&&>::value ==
true`. Blocks if queue is full.
resolution only if `std::is_nothrow_constructible_v<T, P&&>`. Blocks if queue is full.

- `bool try_push(const T &v);`

Expand All @@ -76,8 +75,7 @@ t2.join();
- `template <typename P> bool try_push(P &&v);`

Try to enqueue an item using move construction. Participates in
overload resolution only if `std::is_nothrow_constructible<T,
P&&>::value == true`. Returns `true` on success and `false` if queue
overload resolution only if `std::is_nothrow_constructible_v<T, P&&>`. Returns `true` on success and `false` if queue
is full.

- `void pop(T &v);`
Expand All @@ -90,6 +88,11 @@ t2.join();
Try to dequeue an item by copying or moving the item into
`v`. Return `true` on sucess and `false` if the queue is empty.

- `template <typename Consumer> bool try_consume(Consumer &&consumer);`

Tries to dequeue an item and pass it to a non-throwing callable as an rvalue.
Returns `true` on success and `false` if the queue is empty.

- `ssize_t size();`

Returns the number of elements in the queue.
Expand Down Expand Up @@ -149,10 +152,7 @@ implementation:
- [X] Add allocator supports so that the queue could be used with huge pages and
shared memory
- [ ] Add benchmarks and compare to `boost::lockfree::queue` and others
- [ ] Use C++20 concepts instead of `static_assert` if available
- [X] Use `std::hardware_destructive_interference_size` if available
- [ ] Add API for zero-copy deqeue and batch dequeue operations
- [ ] Add `[[nodiscard]]` attributes

## About

Expand Down
Loading
Loading