C++ single-file

Open-source C++ projects categorized as single-file

Top 15 C++ single-file Projects

single-file
  1. doctest

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

    Project mention: Doctest is a new C++ testing framework | news.ycombinator.com | 2025-07-09
  2. Stream

    Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.

    Stream logo
  3. 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

  4. Nameof C++

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

  5. tomlplusplus

    Header-only TOML config file parser and serializer for C++17.

  6. nanobench

    Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20

  7. Argh!

    Argh! A minimalist argument handler. (by adishavit)

  8. span-lite

    span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library

  9. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  10. expected-lite

    expected lite - Expected objects in C++11 and later in a single-file header-only library

  11. 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

  12. semver

    Semantic Versioning for modern C++ (by Neargye)

  13. imgui_entt_entity_editor

    A drop-in entity editor for EnTT with Dear ImGui

  14. serializer

    A single header standard C++ serialization framework. (by eyalz800)

  15. scope_guard

    A modern C++ scope guard that is easy to use but hard to misuse.

  16. ring-span-lite

    ring-span lite - A C++yy-like ring_span type for C++98, C++11 and later in a single-file header-only library

  17. reflect

    A single file header only static reflection library for C++20. (by M-Fatah)

  18. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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).

C++ single-file discussion

Log in or Post with

C++ single-file related posts

  • Refactoring with C++17 std::optional

    2 projects | /r/cpp | 22 May 2023
  • Is there a std::string::split or something similar?

    2 projects | /r/cpp_questions | 13 Mar 2023
  • The 23 year-old C++ developers with three job offers over $500k

    2 projects | /r/cpp | 22 Apr 2022
  • Nanobench: Fast, Accurate, Single-Header Microbenchmarking Functionality For C++

    2 projects | /r/cpp | 9 Nov 2021
  • C++ Return: std::any, std::optional, or std::variant?

    1 project | /r/cpp | 20 Sep 2021
  • A note from our sponsor - Stream
    getstream.io | 15 Jul 2025
    Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure. Learn more →

Index

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

# Project Stars
1 doctest 6,305
2 Magic Enum C++ 5,527
3 Nameof C++ 2,213
4 tomlplusplus 1,790
5 nanobench 1,570
6 Argh! 1,383
7 span-lite 498
8 expected-lite 477
9 string-view-lite 443
10 semver 330
11 imgui_entt_entity_editor 239
12 serializer 195
13 scope_guard 191
14 ring-span-lite 159
15 reflect 15

Sponsored
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io