C++20-oriented std-mimicking primitives implemented from scratch under namespace nonstd.
This project focuses on practical, inspectable implementations with fixed-capacity variants where appropriate.
- Namespace:
nonstd - Naming: aligned with standard library naming when available (
array,vector,deque,queue,stack,map,multimap,set,multiset,unordered_set,unordered_multiset,unordered_map,span,pair,priority_queue,optional,variant,bitset,unique_ptr,shared_ptr,weak_ptr,jthread) plus pragmatic extensions likedevector,small_vector,stable_vector,spsc_queue,intrusive_list,intrusive_queue,intrusive_stack, andintrusive_slist - Test style: Given / When / Then scenario naming
- Coverage direction: containers + general utilities + algorithms + memory management (C++20-era scope inspired by cppreference domains)
-
Containers: sequence/adaptor/associative/unordered families (
array,vector,small_vector,stable_vector,deque,devector,circular_buffer,forward_list,list,intrusive_list,intrusive_queue,intrusive_stack,intrusive_slist,queue,stack,priority_queue,map,multimap,set,multiset,unordered_*,string,span,bitset) -
Utilities:
optional,expected/unexpected,any,scope_exitfamily,pair,tuple,variant, fixed-capacityfunction, non-owningfunction_ref, fixed-capacity move-onlymove_only_function -
Memory:
unique_ptr,shared_ptr/weak_ptr,intrusive_ptr+intrusive_ref_counter,observer_ptr, memory primitives,memory_resource+polymorphic_allocator -
Concurrency:
thread_pool,jthread,spsc_queue,latch,counting_semaphore/binary_semaphore,barrier,shared_mutex,stop_source/stop_token/stop_callback -
Algorithms: search/count, predicates, transform/copy, ordering, partition/reverse, heap helpers, min/max/clamp
-
Canonical umbrella headers:
nonstd/containersnonstd/associativenonstd/unorderednonstd/utilitiesnonstd/algorithmsnonstd/memorynonstd/concurrencynonstd/all
For authoritative details and at-a-glance coverage, see FEATURES.md.
cmake --preset default
cmake --build --preset default(Manual fallback)
cmake -S . -B build
cmake --build buildctest --preset default(Manual fallback)
ctest --test-dir build --output-on-failure# Build first, then run any produced example binary
cmake --build --preset default
# discover built examples
find build -maxdepth 1 -type f -name '*_example' -printf '%f\n'
# sample runs
./build/array_example
./build/thread_pool_example
./build/latch_example
./build/semaphore_example
./build/spsc_queue_exampleinclude/nonstd/— std-style header surface for nonstd primitivestests/— scenario-style executable tests (Given/When/Then naming)examples/— focused usage samplesFEATURES.md— authoritative implemented feature index and roadmap
GitHub Actions pipeline (.github/workflows/ci.yml) runs these jobs:
container-guard— enforces nonstd internal container policycppcheck— static analysis viascripts/ci_cppcheck.shtidy-format— clang-format check + clang-tidy checkgtest— GoogleTest build and execution for alltests/test_*.cppcoverage— gcovr coverage report generation + artifact uploadsanitizers— ASan/UBSan build and test runpackaging— smoke + CPack TGZ artifact upload (gated by all prior jobs)
cmake -S . -B build
cmake --build build
cpack --config build/CPackConfig.cmake -G TGZ- CMake auto-discovers
tests/test_*.cppandexamples/*_example.cpp. - All tests are GoogleTest-based and run through CTest discovery.
- Current container implementations are intentionally fixed-capacity in several cases for deterministic behavior and clear ownership semantics.