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

    Tell us how you use coding tools. You may win a prize! Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!

    JetBrains 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. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla 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 - InfluxDB
    www.influxdata.com | 2 Sep 2025
    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. 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,375
2 Magic Enum C++ 5,645
3 Nameof C++ 2,229
4 tomlplusplus 1,852
5 nanobench 1,594
6 Argh! 1,396
7 span-lite 503
8 expected-lite 487
9 string-view-lite 445
10 semver 337
11 imgui_entt_entity_editor 244
12 serializer 195
13 scope_guard 191
14 ring-span-lite 161
15 reflect 15

Sponsored
Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com

Did you know that C++ is
the 7th most popular programming language
based on number of references?