awesome-header-only-cpp
A collection of awesome header-only C++ libraries
Argument Parsing
-
argh: Argh! A minimalist argument handler.
-
argparse: Argument Parser for Modern C++
-
args: A simple header-only C++ argument parser library. Supposed to be flexible and powerful, and attempts to be compatible with the functionality of the Python standard argparse library (though not necessarily the API).
-
CLI11: CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.
-
clipp: easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation
-
flags: ⛳ Simple, extensible, header-only C++17 argument parser released into the public domain.
-
structopt: Parse command line arguments by defining a struct
Benchmarking
- nanobench: Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20
Compression
Data Formats
-
cppcodec: Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. MIT licensed with consistent, flexible API.
-
cpptoml: cpptoml is a header-only library for parsing TOML
-
inih: This is a header only C++ version of inih.
-
jsoncons: A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
-
nlohmann/json: JSON for Modern C++
-
picojson: a header-file-only, JSON parser serializer in C++
-
taocpp/json: C++ header-only JSON library
-
toml11: TOML for Modern C++
-
tomlplusplus: Header-only TOML config file parser and serializer for C++17 (and later!).
-
valijson: Header-only C++ library for JSON Schema validation
-
xml2json: A header-only C++ library converts XML to JSON
Data Mining, Machine Learning, and Deep Learning
-
frugally-deep: Header-only library for using Keras models in C++.
-
hnswlib: Header-only C++/python library for fast approximate nearest neighbors
-
MiniDNN: A header-only C++ library for deep neural networks
-
nanoflann: nanoflann: a C++11 header-only library for Nearest Neighbor (NN) search with KD-trees
-
tiny-dnn: header only, dependency-free deep learning framework in C++14
Data Modeling
-
HighFive: HighFive - Header-only C++ HDF5 interface
-
sqlite_orm: SQLite ORM light header only library for modern C++
-
units: a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
Data Presentation
-
cxx-prettyprint: A header-only library for C++(0x) that allows automagic pretty-printing of any container.
-
matplotlib-cpp: Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
Data Processing and Analysis
-
libmorton: C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates
-
kalman: Header-only C++11 Kalman Filtering Library (EKF, UKF) based on Eigen3
-
kfr: Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
-
spectra: A header-only C++ library for large scale eigenvalue problems
Data Structures
-
concurrentqueue: A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
-
frozen: a header-only, constexpr alternative to gperf for C++14 users
-
hopscotch-map: C++ implementation of a fast hash map and hash set using hopscotch hashing
-
MPMCQueue: A bounded multi-producer multi-consumer concurrent queue written in C++11
-
parallel-hashmap: A family of header-only, very fast and memory-friendly hashmap and btree containers.
-
robin-hood-hashing: Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
-
robin-map: C++ implementation of a fast hash map and hash set using robin hood hashing
Event Handling Mechanisms, State Machines, and Task Systems
-
eventpp: Event Dispatcher and callback list for C++
-
tinyfsm: A simple C++ finite state machine library
-
transwarp: A header-only C++ library for task concurrency
File System
-
filesystem: An implementation of C++17 std::filesystem for C++11 /C++14/C++17 on Windows, macOS, Linux and FreeBSD.
-
mio: Cross-platform C++11 header-only library for memory mapped file IO
-
tinydir: Lightweight, portable and easy to integrate C directory and file reader
Functional Programming
- FunctionalPlus: Functional Programming Library for C++. Write concise and readable C++ code.
GUI
- GuiLite: The smallest header-only GUI library(5 KLOC) for all platforms
Geometry, Graphics Processing, and Game Development
-
cinolib: A generic programming header only C++ library for processing polygonal and polyhedral meshes
-
cr: cr.h: A Simple C Hot Reload Header-only Library
-
earcut.hpp: Fast, header-only polygon triangulation
-
entt: Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
-
librg: 🚀 Making multi-player gamedev simpler since 2017
-
nanort: NanoRT, single header only modern ray tracing kernel.
-
tiny-differentiable-simulator: Tiny Differentiable Simulator is a header-only C++ physics library with zero dependencies.
-
voxelizer: Header only mesh voxelizer in c99
-
vuda: VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications.
HTTP and the Web
-
cinatra: modern c++(c++17), cross-platform, header-only, easy to use http framework
-
cpp-httplib: A C++11 single-file header-only cross platform HTTP/HTTPS library.
-
crow: Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
Language Bindings
-
jni.hpp: A modern, type-safe, header-only, C++14 wrapper for JNI (Java Native Interface)
-
Selene: Simple C++11 friendly header-only bindings to Lua
Logging
Mocking
-
FakeIt: C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
-
trompeloeil: Header only C++14 mocking framework
Networking
-
brynet: A Header-Only cross-platform C++ TCP network library
-
cppzmq: Header-only C++ binding for libzmq
-
uvw: Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
Optimization
- ensmallen: A header-only C++ library for numerical optimization
Parsing Expression Grammars
-
cpp-peglib: A single file C++ header-only PEG (Parsing Expression Grammars) library
-
PEGTL: Parsing Expression Grammar Template Library
Querying
- boolinq: Simplest C++ header-only LINQ template library
Random
- random: Random for modern C++ with convenient API
Reflection
-
better-enums: C++ compile-time enum to string, iteration, in a single header file
-
magic_enum: Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
-
meta: Header-only, non-intrusive and macro-free runtime reflection system in C++
-
nameof: Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
-
visit_struct: A miniature library for struct-field reflection in C++
Regular Expressions
- compile-time-regular-expressions: A Compile time PCRE (almost) compatible regular expression matcher.
Robitics
- manif: A small c++11 header-only library for Lie theory.
Security
- PicoSHA2: a header-file-only, SHA256 hash generator in C++
SIMD
-
libsimdpp: Portable header-only C++ low level SIMD library
-
tsimd: Fundamental C++ SIMD types for Intel CPUs (sse, avx, avx2, avx512)
Standard/Support Libraries
-
expected-lite: expected lite - Expected objects in C++11 and later in a single-file header-only library
-
gsl-lite: gsl-lite – A single-file header-only version of ISO C++ Guidelines Support Library (GSL) for C++98, C++11, and later
-
hana: Your standard library for metaprogramming
-
optional-lite: optional lite - A C++17-like optional, a nullable object for C++98, C++11 and later in a single-file header-only library
-
span-lite: span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library
-
string-view-lite: string_view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library
-
variant-lite: variant lite - A C++17-like variant, a type-safe union for C++98, C++11 and later in a single-file header-only library
Statistics
- stats: A C++ header-only library of statistical distribution functions.
Templating Engines
- inja: A Template Engine for Modern C++
Terminal Utilities
-
indicators: Activity Indicators for Modern C++
-
rang: A Minimal, Header only Modern c++ library for terminal goodies 💄✨
-
termcolor: Termcolor is a header-only C++ library for printing colored messages to the terminal. Written just for fun with a help of the Force.
Testing Frameworks
-
Catch2: A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later
-
doctest: The fastest feature-rich C++11/14/17/20 single-header testing framework
-
lest: A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD (includes C++98 variant)
-
ut: UT: C++20 μ(micro)/Unit Testing Framework