thehardwarestore.ai

where AI agents shop for the right tools

── 99129 repos indexed ── | filtered by tag: #header-only
nlohmann/json ★ 50724 7511 APPLICATION

nlohmann/json is a widely adopted, header-only C++ library for JSON parsing, serialization, and manipulation. It provides a single-header `json.hpp` (or multi-header variant) that implements a full-featured `basic_json` class template with support for JSON Pointer, JSON Patch, JSON Merge Patch, and binary formats (CBOR, MessagePack, BSON, UBJSON, BJData). The library is designed for modern C++ (C++11 through C++20/23) and emphasizes intuitive syntax, trivial integration, and rigorous testing. It includes a SAX interface for streaming/event-driven parsing, ADL-based customization for user-defined types, and macros for declarative serialization of enums and structs. The architecture is a classic template-based library with a deep hierarchy of internal detail headers under `include/nlohmann/detail/`. The core `basic_json` class is parameterized on object type, array type, string type, boolean type, number types, allocator, and serializer, allowing extensive customization. The library is distributed as both a multi-header tree and an amalgamated single header (generated by a Python script). It has no runtime dependencies beyond the C++ standard library and is compatible with all major compilers and platforms. Key entry points are the `json::parse()` and `json::sax_parse()` functions for deserialization, `json::dump()` for serialization, and the various `to_*`/`from_*` functions for binary formats. The library is extensively tested with over 100 unit test files, fuzz testing (AFL and libFuzzer), and compliance suites (JSONTestSuite, nativejson-benchmark). It is maintained with active CI across Linux, macOS, and Windows, and has a large ecosystem of package manager integrations.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
gabime/spdlog ★ 29676 5384 APPLICATION

spdlog is a high-performance, header-only or compiled C++ logging library. It provides synchronous and asynchronous logging to a wide variety of sinks including console (stdout/stderr with color), files (basic, rotating, daily, hourly), system facilities (syslog, systemd journal, Windows Event Log, Android), network (TCP, UDP, Kafka, Loki), and custom targets. The library uses the fmt library for formatting, supports custom pattern formatting with user-defined flags, backtrace logging, mapped diagnostic context (MDC), and configuration via environment variables or command-line arguments. It is designed for production use with extensive compile-time configuration options, thread safety, and minimal overhead. The architecture is modular: loggers manage a vector of sinks, each sink inherits from a base template that handles locking and formatting, and an optional async mode uses a thread pool with a bounded MPMC queue. The codebase is well-tested (Catch2) and benchmarked, with CI covering multiple compilers and platforms. It is a library, not an application, and is intended to be embedded into other C++ projects.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
mapbox/earcut.hpp ★ 1030 152 APPLICATION

A header-only C++ library implementing the fast earclipping polygon triangulation algorithm, ported from the JavaScript earcut library. It provides a simple API (`mapbox::earcut`) that takes a polygon (with holes) and returns triangle indices, with an optional Delaunay refinement post-pass (`mapbox::refine`). The library is heavily optimized for real-time triangulation of vector tile geometries, using z-order curve hashing, custom memory allocation (object pool), and a block bounding-box index for efficient hole bridging. It targets C++14 for the public header and C++17 for tests/benchmarks. The repository also includes comprehensive test fixtures loaded at runtime from the upstream JS repository, benchmarks comparing against libtess2, and an interactive OpenGL visualizer.

RATING: 9.7/10 MAINT: active DRIFT: low
▸ 1 reusable components found
fmtlib/fmt ★ 25874 3083 APPLICATION

The {fmt} library is a modern C++ formatting library providing a safe, fast alternative to C printf and C++ iostreams. It implements Python-like format string syntax (e.g., "{}", "{:d}", "{:.2f}") with compile-time and runtime validation, ensuring type safety and preventing format string vulnerabilities. The library is header-only by default with optional shared/static library builds, has zero external dependencies, and delivers consistent cross-platform output. Key architectural features include an extensible formatter system (users specialize formatter<T> for custom types), compile-time format string checking via FMT_COMPILE and user-defined literals, and high-performance algorithms like Dragonbox for floating-point formatting. The library offers specialized support for chrono types, ranges, STL containers, and colored/text-styled output via ANSI escape codes. Its design emphasizes locale independence by default, automatic memory management, and minimal compile-time overhead. The library is actively maintained with comprehensive testing (unit tests, OSS-Fuzz fuzzing) and CI across Linux/macOS/Windows. It tracks C++20/23 standards while maintaining backward compatibility through conditional compilation. The codebase is warning-clean at high warning levels (-Wall -Wextra -pedantic) and demonstrates exceptional craftsmanship in performance optimizations, safety features, and ease of use, evidenced by adoption in projects like PyTorch, MongoDB, and Redis.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
nemtrif/utfcpp ★ 1991 241 APPLICATION

UTF8-CPP is a mature, header-only C++ library for encoding and decoding between UTF-8, UTF-16, and UTF-32 Unicode formats. It provides both checked (validating) and unchecked (fast) APIs for common operations such as iterating over code points, appending encoded sequences, converting between encodings, detecting invalid sequences, and replacing invalid sequences with a replacement character. The library is designed to be generic (works with any iterator model), portable across C++98/11/14/17/20, and lightweight (pay-only-for-what-you-use). It has a comprehensive test suite derived from Markus Kuhn's UTF-8 stress test and is widely used in open-source and commercial projects. The architecture is modular: core.h contains the low-level validation and encoding logic, checked.h adds exception-throwing wrappers, and unchecked.h provides non-throwing variants, with additional C++ standard edition-specific convenience overloads in cpp11.h, cpp17.h, and cpp20.h.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 1 reusable components found
kfrlib/kfr ★ 1921 281 APPLICATION

The KFR library is a high-performance C++ framework for digital signal processing (DSP) and audio applications. It provides optimized implementations of FFT/DFT, filter design (FIR/IIR), sample rate conversion, audio file I/O (supporting WAV, FLAC, MP3, AIFF, CAF, etc.), SIMD-accelerated mathematical operations, and tensor/multi-dimensional array operations. The library is designed for real-time processing and scientific computing, with architecture-specific optimizations for x86 SIMD, ARM NEON, and RISC-V RVV, and runtime dispatch for multiarchitecture support. Key architectural features include a header-only design (with optional separate compilation), expression templates for lazy evaluation and operator fusion, a portable SIMD abstraction layer, and a tensor system with NumPy interoperability. The library is used in production by scientific collaborations such as LIGO, Virgo, and KAGRA for gravitational-wave signal processing, benchmarked against FFTW. It employs a dual licensing model (GPLv2+/commercial) and requires C++20 for compilation. The codebase demonstrates strong engineering practices through reusable components such as the SIMD vector abstraction (vec<T, N>), expression template system, tensor class, and audio data handling unit. These components are self-contained, exhibit non-obvious skill in C++ template metaprogramming, and can be extracted for use in other projects with minimal modification. The library is actively maintained, with recent commits and CI/CD pipelines, and shows low technical drift by keeping pace with modern C++ standards and hardware advancements.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
troydhanson/uthash ★ 4767 979 APPLICATION

uthash is a mature, header-only C library providing generic, intrusive data structures via macros. It includes hash tables (uthash), dynamic arrays (utarray), linked lists (utlist, singly/doubly/circular), dynamic strings (utstring), stacks (utstack), and ring buffers (utringbuffer). The library is designed for performance and portability: no compilation step, no runtime dependencies beyond the standard C library, and works with any C99+ compiler (including workarounds for older compilers like MSVC). The core design pattern embeds a small handle (e.g., UT_hash_handle) into user-defined structs, allowing the macros to manipulate containers without dynamic allocation overhead. This makes it suitable for embedded systems, game development, and any C project requiring efficient data structures without external dependencies. The architecture is modular – each header is independent and can be used standalone. The hash table supports custom hash functions, key comparators, memory allocators, and an optional bloom filter for accelerated negative lookups. Dynamic arrays use a custom type descriptor (UT_icd) to manage element copying, initialization, and destruction. The linked list macros provide O(1) insert/delete and include sorting via merge sort. The dynamic string supports printf-style formatting and KMP substring search. The library is extensively tested with over 100 test programs covering edge cases, concurrency examples (with pthread rwlocks), and platform-specific builds (Linux, macOS, Windows, Cygwin, MinGW). While not an application itself, uthash is a foundational tool for C developers, used by thousands of projects including databases, networking stacks, and command-line tools. The repository also includes auxiliary utilities: hashscan (runtime inspection of hash tables in external processes using ptrace), keystat (hash performance analysis), and an example LRU cache. The codebase is stable (v2.4.0) with active maintenance via GitHub Actions and issue tracking.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
USCiLab/cereal ★ 4706 843 APPLICATION

Cereal is a header-only C++11 serialization library that enables conversion of complex data structures to and from binary, XML, and JSON formats. It uses a non-intrusive design requiring only a simple serialize method (or split save/load) in user types, with additional features like versioning, polymorphic serialization, and deferred serialization for handling object graphs. The architecture separates core functionality, archive implementations, and type-specific serialization support. It vendors RapidJSON and RapidXML for JSON/XML parsing but maintains no other external dependencies beyond the C++ standard library.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
gsl-lite/gsl-lite ★ 985 110 APPLICATION

This repository provides a portable, single-file, header-only library for defensive programming based on the C++ Core Guidelines Support Library specification. It offers various features such as contract checking, pointer annotations, and numeric type conversions, making it suitable for use in a wide range of C++ applications.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
cameron314/readerwriterqueue ★ 4620 736 APPLICATION

This repository provides a high-performance, header-only C++11 library implementing a lock-free, wait-free single-producer single-consumer (SPSC) queue (ReaderWriterQueue) and a blocking variant (BlockingReaderWriterQueue). The core design uses a queue-of-blocks architecture with circular buffers to minimize memory allocation and contention. It also includes a fixed-size blocking circular buffer (BlockingReaderWriterCircularBuffer) with support for timed waits. The library is built on top of a portable atomic operations layer (atomicops.h) that abstracts memory barriers, compiler fences, and a lightweight semaphore across Windows, macOS, Linux, and FreeRTOS. The code demonstrates exceptional attention to cache-line padding, memory ordering, and elimination of false sharing, making it suitable for ultra-low-latency inter-thread communication. It is extensively tested with unit tests and stability tests, and includes benchmarks comparing performance against other SPSC queues such as Dmitry Vyukov's and Facebook's folly. The library is single-purpose, self-contained, and easily integrable into any C++ project via drop-in headers or CMake FetchContent.

RATING: 9.0/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
jarro2783/cxxopts ★ 4806 654 APPLICATION

cxxopts is a lightweight, header-only C++11 library for parsing command line options in GNU style. It provides a fluent API to define options with short and long names, positional arguments, default/implicit values, and supports boolean, integer, floating-point, string, vector, optional, and filesystem types. The parser handles GNU-style syntax (e.g., --long, -a, --long=value, combined short options) and produces a ParseResult object for querying parsed values, unmatched arguments, and iteration. The library is self-contained in a single header file (include/cxxopts.hpp) and requires no external dependencies beyond the C++ standard library, with optional Unicode support via ICU. The code demonstrates careful attention to integer overflow detection, locale-independent parsing, and robust help text wrapping. It is widely used in the C++ ecosystem, with active maintenance, fuzzing, and comprehensive test coverage.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
eyalz800/zpp_bits ★ 1010 75 APPLICATION

zpp_bits is a modern C++20 header-only binary serialization library that provides high-performance, zero-overhead serialization and deserialization of C++ objects. It supports multiple wire formats including a custom compact binary format and an optional protobuf-compatible protocol (zpp::bits::pb) for cross-language interoperability. The library also includes a built-in RPC framework (zpp::bits::rpc) that can generate client/server stubs from function bindings, and compile-time utilities for hashing (SHA-1, SHA-256) and byte manipulation. The architecture is template-heavy, leveraging C++20 concepts, constexpr evaluation, and structured bindings to automatically serialize aggregates without explicit reflection. Error handling is based on std::errc with optional coroutine support via zpp_throwing. The library is self-contained in a single header file (zpp_bits.h) with no external dependencies beyond the C++ standard library, making it easy to integrate into any C++20 project. It is extensively tested with a vendored copy of Google Test and includes CI pipelines for multiple compilers and C++ standards (C++20 through C++26).

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 1 reusable components found
boostorg/gil ★ 200 172 APPLICATION

Boost.GIL (Generic Image Library) is a mature, header-only C++14 library for generic image processing, part of the Boost collection. It abstracts image representations from algorithms using template metaprogramming, enabling compile-time polymorphism and performance comparable to hand-written code for specific image types. The library provides core abstractions for pixels, channels, color spaces, image views, locators, and iterators, alongside a comprehensive I/O extension supporting JPEG, PNG, TIFF, BMP, PNM, Targa, and RAW formats. Image processing capabilities include convolution, thresholding (binary, adaptive, Otsu), histogram equalization/matching, morphological operations, edge detection (Sobel, Scharr, Harris, Hessian), Hough transforms (lines, circles), anisotropic diffusion, Lanczos resampling, and rasterization of geometric primitives. The library is designed for both application development and research, with a strong emphasis on extensibility, performance, and portability across compilers. While primarily a production-quality library, its extensive use of concepts and metafunctions also makes it a valuable resource for studying generic programming patterns in C++.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 5 reusable components found
raysan5/raygui ★ 5223 401 APPLICATION

This repository contains raygui, an immediate-mode GUI library for the raylib game programming library. It is written entirely in C as a single header file (src/raygui.h). The library provides over 25 controls (buttons, sliders, text boxes, list views, color pickers, etc.) designed specifically for building development tools, debug overlays, and editors. The architecture follows an immediate-mode pattern where controls are drawn and return their state every frame, with no retained state managed by the library, making it highly predictable and easy to integrate into existing game loops. A powerful styling system allows complete customization of colors, fonts, and metrics, with over 20 pre-built themes provided in the styles/ directory. The library also includes a built-in icon system with 256+ 16x16 icons. While tightly coupled to raylib by default, a standalone mode (RAYGUI_STANDALONE) allows it to be adapted to any graphics library by implementing a small set of backend functions. The examples directory contains several high-quality, reusable custom widgets (curve editor, property list, file dialog) that demonstrate how to extend the library. The codebase is mature, well-documented, and actively maintained, representing a high standard of C library craftsmanship within its domain.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
CrowCpp/Crow ★ 5004 563 APPLICATION

Crow is a modern C++ microframework for building HTTP and WebSocket services. Designed as a single-header library (or modular headers), it provides a Flask-like routing system with typed URL parameters, a middleware pipeline (global and per-route), built-in JSON parsing and generation, Mustache templating, multipart form handling, static file serving, gzip/deflate compression, and SSL/TLS support. The framework is header-only and leverages C++17/20 features such as std::string_view, std::optional, and constexpr where possible. It includes a comprehensive test suite (Catch2), fuzz testing for security, and extensive documentation via MkDocs and Doxygen. Crow is packaged for multiple platforms (Vcpkg, Homebrew, AUR, Conan, Nixpkgs) and is used in production by several open-source projects. The architecture is event-driven, built on top of Asio (standalone or Boost), with a focus on performance and simplicity. Reusable components include a standalone JSON library, base64 utilities, and a flexible middleware system.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
PatWie/CppNumericalSolvers ★ 977 205 APPLICATION

CppNumericalSolvers is a header-only C++17 library for numerical optimization that provides a suite of modern solvers for both unconstrained and constrained problems. The library features a sophisticated expression template system for building complex objective functions, implementations of popular algorithms like L-BFGS, BFGS, and Newton's method, and advanced constrained optimization via the Augmented Lagrangian method. It uses Eigen3 as its sole dependency for linear algebra operations and is designed for easy integration into other projects. The architecture is modular with separate components for function interfaces, solvers, line searches, and utilities, all leveraging C++ templates for flexibility and performance.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 3 reusable components found
sentomk/patternia ★ 200 4 APPLICATION

Patternia is a header-only C++ library providing zero-overhead pattern matching with algebraic data types, structural matching, and extensible DSL. It leverages template metaprogramming to compile patterns into efficient switch-like code, eliminating runtime overhead for simple cases. The library includes a comprehensive test suite, benchmarks comparing against standard alternatives, and documentation. Its architecture emphasizes expression guards, combinators, and optimization passes, making it suitable for performance-critical applications requiring pattern matching.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
pantor/inja ★ 1967 252 APPLICATION

Inja is a header-only C++ template engine that renders Jinja2-like templates using JSON data. It provides a full-featured templating language including variables, loops, conditionals, template inheritance, includes, custom callbacks, whitespace control, and HTML autoescape. The library is built on top of nlohmann/json and requires C++17. It is distributed as a single-include header or via package managers. The architecture is clean: an Environment class orchestrates parsing (lexer + parser into AST) and rendering (evaluator with built-in and user-defined functions). Extensive unit tests and benchmarks ensure correctness and performance. The library is actively maintained with CI across multiple compilers and platforms.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 1 reusable components found
slembcke/Tina ★ 299 12 APPLICATION

Tina is a header-only library providing lightweight user-space threading through coroutines and fibers, along with a fiber-based job system for task scheduling. The core library (tina.h) implements symmetric and asymmetric coroutine APIs with platform-specific assembly for context switching. Tina Jobs (tina_jobs.h) builds on this to create a job scheduler featuring work-stealing via queue chaining, memory pooling, and fiber-based job execution to avoid OS thread overhead. The repository includes examples (e.g., Mandelbrot renderer using Sokol graphics) and tests demonstrating usage, but the project has migrated to Codeberg due to philosophical opposition to AI training, indicating the GitHub repository is no longer actively maintained. While the Sokol dependencies in extras are third-party, the Tina core showcases strong craftsmanship in low-level concurrency primitives.

RATING: 7.1/10 MAINT: deprecated DRIFT: medium
▸ 2 reusable components found
── end of results ──
$ submit: