|
1 | | -      |
| 1 | +       |
2 | 2 |
|
3 | 3 | A modern C++ header-only library of various types of queue |
4 | 4 |
|
| 5 | +- `concurrent_queue` provides synchronized FIFO access for multiple producers and consumers. In addition to `push` and `emplace`, consumers can use non-blocking `try_pop` or bounded-wait `try_pop_for` operations. |
| 6 | +- `circular_queue` is an allocator-aware, fixed-capacity contiguous container with random-access iterators. When full, insertion overwrites the oldest element at the opposite end. |
| 7 | + |
5 | 8 | # Table of Contents |
6 | 9 |
|
7 | 10 | - [Table of Contents](#table-of-contents) |
| 11 | +- [Compatibility](#compatibility) |
| 12 | +- [Release 1.2.0](#release-120) |
8 | 13 | - [Build Instructions](#build-instructions) |
9 | 14 | - [Usage](#usage) |
10 | 15 | - [Concurrent Queue](#concurrent-queue) |
11 | 16 | - [Example](#example) |
12 | 17 | - [Circular Queue](#circular-queue) |
13 | 18 | - [Example](#example-1) |
14 | 19 |
|
| 20 | +# Compatibility |
| 21 | + |
| 22 | +Release 1.2.0 requires C++23. The versions below are the minimum compiler baselines exercised by each release's CI or explicitly documented by that release; newer compiler releases are expected to work as well. |
| 23 | + |
| 24 | +| Release | Language standard | Minimum tested compilers | Minimum CMake | |
| 25 | +| --- | --- | --- | --- | |
| 26 | +| 1.2.0 | C++23 | GCC 13, Clang 18, MSVC 2022 | 3.25 | |
| 27 | +| 1.1.x | C++20 | GCC 11.4, Clang 14, MSVC 2022 | 3.7 | |
| 28 | +| 1.0.x | C++17 | GCC 9.3, MSVC 2019 | 3.7 | |
| 29 | + |
| 30 | +Compiler versions not listed for an older release were not pinned by that release's build configuration and are therefore not part of its documented compatibility baseline. Other compilers may work, but are not supported unless covered by CI. |
| 31 | + |
| 32 | +# Release 1.2.0 |
| 33 | + |
| 34 | +The 1.2.0 release moves the library to C++23 and adds range-aware construction, `assign_range`, and `insert_range` to `circular_queue`. Both queue types support three-way comparison when their stored types and underlying containers support it. This release also expands the GCC, Clang, and MSVC CI matrix with coverage and sanitizer builds. |
| 35 | + |
15 | 36 | # Build Instructions |
16 | 37 |
|
17 | 38 | Each class in the library itself is a single header only. You can use the included CMake in a subdirectory and add the interface library, or just copy the `*.h` files (and license) into your project. |
18 | 39 |
|
| 40 | +Building the repository requires CMake 3.25 or newer and a C++23 compiler from the 1.2.0 compatibility row above. The queue headers themselves have no third-party runtime dependency. Tests require a thread library and GoogleTest 1.17 (fetched automatically when it is not installed); documentation generation requires Doxygen, with `pdflatex` needed only for the optional PDF. |
| 41 | + |
| 42 | +When the repository is included with `add_subdirectory`, link the header-only interface target to inherit its include path: |
| 43 | + |
| 44 | +``` cmake |
| 45 | +add_subdirectory(queue) |
| 46 | +target_link_libraries(my_target PRIVATE queue) |
| 47 | +``` |
| 48 | + |
19 | 49 | To build and run the unit tests: |
20 | 50 |
|
21 | 51 | ``` bash |
22 | | -mkdir build |
23 | | -cd build |
24 | | -cmake -DBUILD_TESTS=ON .. |
25 | | -cmake --build . --config Release |
26 | | -ctest |
| 52 | +cmake -S . -B build -DQUEUE_BUILD_TESTS=ON -DQUEUE_BUILD_DOCUMENTATION=OFF |
| 53 | +cmake --build build --config Release |
| 54 | +ctest --test-dir build --build-config Release --output-on-failure |
27 | 55 | ``` |
28 | 56 |
|
29 | | -To build the documentation, replace the above `cmake` command with the following: |
| 57 | +To configure and build the generated documentation: |
30 | 58 |
|
31 | | -``` |
32 | | -cmake -DBUILD_TESTS=ON -DBUILD_DOCUMENTATION=ON .. |
| 59 | +``` bash |
| 60 | +cmake -S . -B build -DQUEUE_BUILD_TESTS=OFF -DQUEUE_BUILD_DOCUMENTATION=ON |
| 61 | +cmake --build build --target queue_documentation |
33 | 62 | ``` |
34 | 63 |
|
35 | 64 | # Usage |
@@ -137,4 +166,4 @@ int main() |
137 | 166 | } |
138 | 167 | } |
139 | 168 |
|
140 | | -``` |
| 169 | +``` |
0 commit comments