C++ header-only

Open-source C++ projects categorized as header-only | Edit details

Top 23 C++ header-only Projects

  • GitHub repo json

    JSON for Modern C++

    Project mention: So what files can actually be read from an SD card? | reddit.com/r/vex | 2021-09-15
  • GitHub repo 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)

    Project mention: How should I make tests? | reddit.com/r/cpp_questions | 2021-09-26

    Maybe you would be interested in Catch2. I have been using it in all my projects, its pretty good.

  • Nanos

    Run Linux Software Faster and Safer than Linux with Unikernels.

  • GitHub repo spdlog

    Fast C++ logging library.

    Project mention: Need a C++ roguelike engine w/up to date tutorials! | reddit.com/r/roguelikedev | 2021-09-28

    May I also take a moment to recommend spdlog as a logging library. It's just one line of code to add it in to the project, and it's fast and flexible.

  • GitHub repo Crow

    Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)

    Project mention: RESTful API framework | reddit.com/r/cpp_questions | 2021-10-05

    It seems nice, but the framework seems to be dead. There are still open pull requests and the contribution page speaks for itself: https://github.com/ipkn/crow/graphs/contributors

  • GitHub repo cpp-httplib

    A C++ header-only HTTP/HTTPS server and client library

    Project mention: Trying to make https requests in c++ | reddit.com/r/cpp_questions | 2021-10-13

    So I am trying to make a little homescreen app that displays date, time, weather, etc. I'm working on the weather component right now and I'm trying to do it through an api call to the national weather service's api. I found this library for making http requests in C++ and im having some trouble with it. Im making the request with these two lines in my code

  • GitHub repo entt

    Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

    Project mention: Upcoming ECS in UE5 (Mass) | reddit.com/r/unrealengine | 2021-10-03

    Excellent! I've been using ENTT for a UE-compatible C++ ECS library for a while but it'll be good to get something in-engine, and it opens a lot of possibilities for speeding up other parts of the engine too.

  • GitHub repo GuiLite

    ✔️The smallest header-only GUI library(4 KLOC) for all platforms

    Project mention: GUI? | reddit.com/r/cpp | 2021-07-29

    How about Nana? or GuiLite?

  • Scout APM

    Scout APM: A developer's best friend. Try free for 14-days. 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.

  • GitHub repo GLM

    OpenGL Mathematics (GLM)

    Project mention: Should I write a library in C or C++? | reddit.com/r/C_Programming | 2021-07-04

    (C++11) - https://github.com/g-truc/glm

  • GitHub repo doctest

    The fastest feature-rich C++11/14/17/20 single-header testing framework

    Project mention: Best IDE For C++ OpenGL? | reddit.com/r/opengl | 2021-09-14

    I use doctest for unit testing.

  • GitHub repo 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: Circle, the C++ Automation Language | news.ycombinator.com | 2021-10-16
  • GitHub repo compile-time-regular-expressions

    A Compile time PCRE (almost) compatible regular expression matcher.

    Project mention: any c++ devs on twitter i should follow? | reddit.com/r/cpp_questions | 2021-06-17
  • GitHub repo indicators

    Activity Indicators for Modern C++

    Project mention: It there a library for creating a progress bar? | reddit.com/r/cpp_questions | 2021-03-31

    Maybe this one: https://github.com/p-ranav/indicators

  • GitHub repo FunctionalPlus

    Functional Programming Library for C++. Write concise and readable C++ code.

    Project mention: Why C++ for everything? | reddit.com/r/ROS | 2021-04-28

    As idiomatic, I will try to adopt as much as possible purely functional programming in C++ by using https://github.com/Dobiasd/FunctionalPlus . Do you have by any chance any alternative suggestion?

  • GitHub repo PEGTL

    Parsing Expression Grammar Template Library

    Project mention: We Built a C++ Rendering Engine for the Web | news.ycombinator.com | 2021-07-10

    As a professional C++ programmer I feel a lot of the reasons C++ gets this response is because it's simply not "batteries included" like Go or Rust.

    C++ is a very powerful, unopinionated language, that gives you a lot of freedom to attack your problem domain the way you best see fit.

    If you're writing a networked application, don't use POSIX sockets, go and find a higher level library. If you're parsing complex text formats, don't iterate over buffers with char*'s, go pick up PEGTL[0]. If you're working on graphs, or need to properly index in-memory data, go pick up Boost[1][2]. If you need a GUI, go pick up Qt.

    It's extremely common in C++, due to the lack of a universal package management solution, for people to try and "muddle through" and do shit themselves when it's far outside their core competency.

    At one of my last employers, the core product was parsing JSON with std::regex, simply because they couldn't be bothered to integrate a JSON library.

    [0] https://github.com/taocpp/PEGTL

    [1] https://www.boost.org/doc/libs/1_76_0/libs/graph/

    [2] https://www.boost.org/doc/libs/1_76_0/libs/multi_index/doc/i...

  • GitHub repo uvw

    Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!

    Project mention: I hate ASIO and I can't be alone. | reddit.com/r/cpp | 2021-08-14

    Have you tried this wrapper? https://github.com/skypjack/uvw

  • GitHub repo hana

    Your standard library for metaprogramming

    Project mention: Simple `struct` static reflection system I use that tracks names, attributes (in my own code I also keep `constexpr` hashes of names) -- example gets fully inlined into `main()` | reddit.com/r/cpp | 2021-04-24

    And then there's also the longstanding issue with default member initializers -- https://github.com/boostorg/hana/issues/409 -- which was a deal-breaker.The PROP system avoids this issue precisely by having the macro be as local as possible: the default member initializer is outside the macro. It does this while still letting you attach additional PropAttribs metadata (I'm not sure what additional metadata attachment looks like in Hana? haven't really tried). Default values and additional attributes are by and large quite more important to me in my use cases for reflection (component types in game ECS) than range syntax (everything I've needed and can think of needing is covered by for-each loop).

  • GitHub repo plog

    Portable, simple and extensible C++ logging library

  • GitHub repo mio

    Cross-platform C++11 header-only library for memory mapped file IO (by mandreyel)

    Project mention: Fastest way to read very large file(Gb to Tb) in C++ | reddit.com/r/cpp | 2021-05-19

    I would memory map it. Use this lib: https://github.com/mandreyel/mio

  • GitHub repo Nameof C++

    Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum

    Project mention: Getting an Unmangled Type Name at Compile Time | reddit.com/r/cpp | 2021-03-10
  • GitHub repo Better Enums

    C++ compile-time enum to string, iteration, in a single header file

  • GitHub repo robin-hood-hashing

    Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20

    Project mention: how to do memory pool de-fragmentation? | reddit.com/r/gamedev | 2021-08-03

    Sounds like you and I are on similar paths. I gave myself the same goal back in 2018 (build a simple-ish c++/opengl engine and ship a game with it). I'm currently using this library for storing my game object datastructures and this library for key lookups into that primary container. I glue the two together in a `sac.h` template, and I'm done. Is it the most performant thing...probably not...does it work...yes, and it's easily swapped out for something else down the road if the need arises.

  • GitHub repo Argh!

    Argh! A minimalist argument handler. (by adishavit)

  • GitHub repo Inja

    A Template Engine for Modern C++

    Project mention: Looking for a codegen library that uses C++ for scripting | reddit.com/r/cpp | 2021-03-10

    I've looked into a newer template engine like Inja, but my client isn't quite happy with that either. Inja allows you to write templates that you feed JSON data into:

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2021-10-16.


What are some of the best open-source header-only projects in C++? This list will help you:

Project Stars
1 json 26,938
2 Catch 14,093
3 spdlog 12,780
4 Crow 6,526
5 cpp-httplib 5,837
6 entt 5,803
7 GuiLite 5,706
8 GLM 5,553
9 doctest 3,477
10 Magic Enum C++ 2,195
11 compile-time-regular-expressions 2,046
12 indicators 1,726
13 FunctionalPlus 1,465
14 PEGTL 1,416
15 uvw 1,315
16 hana 1,298
17 plog 1,226
18 mio 1,181
19 Nameof C++ 1,177
20 Better Enums 1,174
21 robin-hood-hashing 919
22 Argh! 886
23 Inja 827
Find remote jobs at our new job board 99remotejobs.com. There are 34 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives