C++ single-file

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

Top 15 C++ single-file Projects

  • doctest

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

  • Project mention: Unit testing tool suggestions | /r/learnprogramming | 2023-05-07

    I have never used "tools" for unit-tests, only web sites that show the results of the tests or code coverage. For C++ I prefer https://github.com/doctest/doctest but most companies I worked for use Catch2.

  • 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: What C++ library do you wish existed but hasn’t been created yet? | /r/cpp | 2023-07-08

    I'm not sure this is quite what you're asking for, but this library has been super helpful to me in the past : https://github.com/Neargye/magic_enum

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Nameof C++

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

  • tomlplusplus

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

  • nanobench

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

  • Project mention: The issue of unit tests and performance measurements (Benchmark) | /r/cpp | 2023-05-27

    An alternative is tracking the number of instructions a test executes: https://github.com/martinus/nanobench

  • Argh!

    Argh! A minimalist argument handler. (by adishavit)

  • span-lite

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

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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

  • expected-lite

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

  • Project mention: Refactoring with C++17 std::optional | /r/cpp | 2023-05-22

    Or nonstd::expected. Personally, I would rather use output parameters and an enum result or a std::variant over std::optional, because at the very least you have the option for more specific error diagnostics.

  • semver

    Semantic Versioning for modern C++ (by Neargye)

  • serializer

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

  • scope_guard

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

  • 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

  • reflect

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

  • Project mention: A basic reflection-like system for editing object fields in a C++ game engine | /r/cpp_questions | 2023-05-23

    You can look at it here. If you want to know more about the implementation details, you can read about it here.

  • Savefile-Saver

    A program to backup all of your game savefiles on your system, neatly, and into a single folder.

  • 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 related posts

Index

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

Project Stars
1 doctest 5,574
2 Magic Enum C++ 4,403
3 Nameof C++ 1,937
4 tomlplusplus 1,396
5 nanobench 1,301
6 Argh! 1,278
7 span-lite 486
8 string-view-lite 399
9 expected-lite 348
10 semver 285
11 serializer 185
12 scope_guard 160
13 ring-span-lite 147
14 reflect 14
15 Savefile-Saver 8

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com