Getting Started¶
arrp 1.4.0-34 is a header-only C++20 library for robust, exception-safe generic resource pools.
Add it via CPM, CMake FetchContent, or by copying the include/ directory directly.
System Requirements¶
| Category | Specification |
|---|---|
| Language Standard | C++20 (/std:c++20 on MSVC; -std=c++20 on Clang/GCC) |
| Windows | Microsoft Visual Studio 2022+ (MSVC v143+), architectures: x64, arm64 |
| macOS (Darwin) | AppleClang (Xcode CommandLineTools / LLVM Clang), architecture: arm64 |
| Linux | GCC 13+ or Clang 17+, architectures: x64, arm64 |
| Build Tools | CMake 3.31+ with CMake Presets (v8) and Ninja |
| Target Type | INTERFACE (Header-only) |
Dependencies¶
The following table is auto-generated from CMakeLists.txt at build time.
graph TD
arrp["arrp::arrp 1.4.0-34"]
subgraph Core["Core Dependencies (via CPM)"]
RUNONEND["RunOnEnd 1.4.5"]
end
subgraph TestBench["Test & Diagnostic Dependencies (Conditional)"]
GTEST["gtest v1.17.0"]
NLOHMANNJSON["nlohmann_json v3.12.0"]
end
arrp --> RUNONEND
arrp -.->|BUILD_TESTS=ON| GTEST
arrp -.->|BUILD_TESTS=ON| NLOHMANNJSON
| Dependency | Repository / Target | Version | Type | Scope |
|---|---|---|---|---|
| RunOnEnd | siddiqsoft/ |
1.4.5 | CPM |
All Platforms (INTERFACE) |
| gtest | google/googletest |
v1.17.0 | CPM |
Tests only (arrp_BUILD_TESTS=ON) |
| nlohmann_json | nlohmann/json |
v3.12.0 | CPM |
Tests only (arrp_BUILD_TESTS=ON) |
Installation & Integration¶
Add arrp to your CMakeLists.txt using CPM.cmake:
include(cmake/CPM.cmake)
CPMAddPackage("gh:SiddiqSoft/arrp#v1.4.0")
target_link_libraries(my_target PRIVATE arrp::arrp)
Build options (pass via -D or cmake-presets):
| Option | Default | Description |
|---|---|---|
arrp_BUILD_TESTS |
OFF |
Build unit tests (requires GoogleTest). |
include(FetchContent)
FetchContent_Declare(
arrp
GIT_REPOSITORY https://github.com/SiddiqSoft/arrp.git
GIT_TAG v1.4.0
)
FetchContent_MakeAvailable(arrp)
target_link_libraries(my_target PRIVATE arrp::arrp)
Build options (pass via -D or cmake-presets):
| Option | Default | Description |
|---|---|---|
arrp_BUILD_TESTS |
OFF |
Build unit tests (requires GoogleTest). |
Basic Usage¶
Include <siddiqsoft/:
#include <iostream>
#include <siddiqsoft/arrp.hpp>
int main() {
siddiqsoft::arrp::resource_pool<int> pool(10);
pool.seed(100);
auto guard = pool.try_borrow();
if (guard.is_valid()) {
std::cout << "Borrowed: " << guard.get() << "\n";
}
return 0;
}
Building and Running Tests Locally¶
The repository provides presets configured in CMakePresets.json:
Related Topics¶
API Reference¶
Detailed documentation for siddiqsoft::arrp::resource_pool and siddiqsoft::arrp::resource_guard.