Top 23 C++ header-only Projects
-
json
JSON for Modern C++
Project mention: C++ trainable semantic segmentation models | reddit.com/r/computervision | 2021-02-23This project is under developing. By now, these projects helps a lot. - official pytorch - qubvel SMP - nlohmann json
-
Catch
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)
-
Scout
Get performance insights in less than 4 minutes. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
-
spdlog
Fast C++ logging library.
For me, spdlog is my go-to choice. How does this compare to that? What features do you have planned that might differentiate it?
-
Crow
Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
-
GuiLite
✔️The smallest header-only GUI library(4 KLOC) for all platforms
You can get source code here
-
GLM
OpenGL Mathematics (GLM)
glm [link]
-
entt
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
You should probably look at something like Entt. It's C++, though. I assume you use C based from your sample code.
-
cpp-httplib
A C++ header-only HTTP/HTTPS server and client library
Project mention: What's the simplest way of sending POST/GET requests? | reddit.com/r/cpp | 2021-02-05 -
doctest
The fastest feature-rich C++11/14/17/20 single-header testing framework
Project mention: A header only library for C++ programming language Libr | reddit.com/r/cpp | 2021-01-25I really recommend you checkout doctest https://github.com/onqtam/doctest first
-
compile-time-regular-expressions
A Compile time PCRE (almost) compatible regular expression matcher.
Project mention: Regular Expression COmpiler - Compile a regex ahead of time to code | reddit.com/r/coding | 2021-02-03CTRE is great for C++
-
Magic Enum C++
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
Project mention: finally! a possibly portable way to convert types (demangled name) to strings without macros | reddit.com/r/cpp | 2021-02-08But sure I expect people will try all sorts of tricks. Like this one from magic_enum to get the enum string name via a function signature.
-
indicators
Activity Indicators for Modern C++
p-ranav/indicators offers a very rich api but this is definitely simpler to use.
-
PEGTL
Parsing Expression Grammar Template Library
Project mention: Ask HN: C++17/C++20 example projects with good style? | news.ycombinator.com | 2021-02-06A list of modern C++ related resources can be found here:
https://github.com/rigtorp/awesome-modern-cpp
The list includes some powerful yet not excessively large libraries including:
https://github.com/skypjack/entt
-
FunctionalPlus
Functional Programming Library for C++. Write concise and readable C++ code.
Another option is to use a superbuild CML where you can do all the nasty, platform specific things. Example of a superbuild CML.
-
uvw
Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
-
hana
Your standard library for metaprogramming
oh yes definitely, but I meant more the particular way I've done it so far - which has been to implement something similar to boost::hana::is_valid(), to make it take the least amount of boilerplate code per-use-case as possible: zero additional lines of code.
-
Better Enums
C++ compile-time enum to string, iteration, in a single header file
-
plog
Portable, simple and extensible C++ logging library
-
Nameof C++
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
-
Argh!
Argh! A minimalist argument handler.
-
frugally-deep
Header-only library for using Keras models in C++.
-
Inja
A Template Engine for Modern C++
-
clipp
easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation
Index
What are some of the best open-source header-only projects in C++? This list will help you:
Project | Stars | |
---|---|---|
1 | json | 23,244 |
2 | Catch | 12,784 |
3 | spdlog | 10,962 |
4 | Crow | 6,201 |
5 | GuiLite | 5,246 |
6 | GLM | 4,861 |
7 | entt | 4,851 |
8 | cpp-httplib | 4,462 |
9 | doctest | 3,087 |
10 | compile-time-regular-expressions | 1,771 |
11 | Magic Enum C++ | 1,633 |
12 | indicators | 1,410 |
13 | PEGTL | 1,276 |
14 | FunctionalPlus | 1,252 |
15 | uvw | 1,211 |
16 | hana | 1,196 |
17 | Better Enums | 1,086 |
18 | plog | 1,043 |
19 | Nameof C++ | 988 |
20 | Argh! | 741 |
21 | frugally-deep | 705 |
22 | Inja | 690 |
23 | clipp | 675 |