Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev. Learn more →
Top 23 C++ no-dependency Projects
A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)Project mention: Semi crise existentielle de développeur | /r/QuebecTI | 2023-06-07
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much moreProject mention: Focus: A simple and fast text editor written in Jai | news.ycombinator.com | 2023-09-02
https://pastebin.com/VPypiitk This is a very small experiment i did to learn the metaprogramming features. its an ECS library using the same model as entt (https://github.com/skypjack/entt). In 200 lines or so it does the equivalent of a few thousand lines of template heavy Cpp while compiling instantly and generating good debug code.
Line 8 declares a SparseSet type as a fairly typical template. its just a struct with arrays of type T inside. Next lines implement getters/setters for this data structure
Line 46 Base_Registry things get interesting. This is a struct that holds a bunch of SparseSet of different types, and providers getters/setters for them by type. It uses code generation to do this. The initial #insert at the start of the class injects codegen that creates structure members from the type list the struct gets on its declaration. Note also how type-lists are a native structure in the lang, no need for variadics.
Line 99 i decide to do variadic style tail templates anyway for fun. I implement a function that takes a typelist and returns the tail, and the struct is created through recursion as one would do in cpp. Getters and setters for the View struct are also implemented through recursion
Line 143 has the for expansion. This is how you overload the for loop functionality to create custom iterators.
The rest of the code is just some basic test code that runs the thing.
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate codeProject 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
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.Project mention: Command line interface library | /r/Cplusplus | 2023-03-24
The most feature-rich C++ CLI library is CLI11. Other popular choices include Boost.ProgramOptions, argparse, cxxopts and others.
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20Project mention: Factor is faster than Zig | news.ycombinator.com | 2023-11-10
In my example the table stores the hash codes themselves instead of the keys (because the hash function is invertible)
Oh, I see, right. If determining the home bucket is trivial, then the back-shifting method is great. The issue is just that it’s not as much of a general-purpose solution as it may initially seem.
“With a different algorithm (Robin Hood or bidirectional linear probing), the load factor can be kept well over 90% with good performance, as the benchmarks in the same repo demonstrate.”
I’ve seen the 90% claim made several times in literature on Robin Hood hash tables. In my experience, the claim is a bit exaggerated, although I suppose it depends on what our idea of “good performance” is. See these benchmarks, which again go up to a maximum load factor of 0.95 (Although boost and Absl forcibly grow/rehash at 0.85-0.9):
Tsl, Martinus, and CC are all Robin Hood tables (https://github.com/Tessil/robin-map, https://github.com/martinus/robin-hood-hashing, and https://github.com/JacksonAllan/CC, respectively). Absl and Boost are the well-known SIMD-based hash tables. Khash (https://github.com/attractivechaos/klib/blob/master/khash.h) is, I think, an ordinary open-addressing table using quadratic probing. Fastmap is a new, yet-to-be-published design that is fundamentally similar to bytell (https://www.youtube.com/watch?v=M2fKMP47slQ) but also incorporates some aspects of the aforementioned SIMD maps (it caches a 4-bit fragment of the hash code to avoid most key comparisons).
As you can see, all the Robin Hood maps spike upwards dramatically as the load factor gets high, becoming as much as 5-6 times slower at 0.95 vs 0.5 in one of the benchmarks (uint64_t key, 256-bit struct value: Total time to erase 1000 existing elements with N elements in map). Only the SIMD maps (with Boost being the better performer) and Fastmap appear mostly immune to load factor in all benchmarks, although the SIMD maps do - I believe - use tombstones for deletion.
I’ve only read briefly about bi-directional linear probing – never experimented with it.
Header-only TOML config file parser and serializer for C++17.Project mention: how to handle config files in c++? | /r/cpp_questions | 2023-03-06
Unless you want to make your own config file parser as an exercise (which is a good idea) I'd recommend using toml++.
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).Project mention: C++ Reflection for Component Serialization and Inspection | /r/gameenginedevs | 2023-03-04
I’ve been using https://github.com/veselink1/refl-cpp for my recent project where i needed reflections, especially for serialization. Cant wait for c++48 and reflections in standard
a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
A fast & densely stored hashmap and hashset based on robin-hood backward shift deletionProject mention: unordered_dense: A Fast & Densely Stored Hashmap And Hashset Based On Robin-Hood Backward Shift Deletion | /r/programming | 2023-07-11
The smallest public printf implementation for its feature set.Project mention: nanoprintf VS callback_printf - a user suggested alternative | libhunt.com/r/nanoprintf | 2023-08-16
span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only libraryProject mention: I love building a startup in Rust. I wouldn't pick it again. | /r/programming | 2023-02-18
Another solution: use std::span (or some alternative implementations if the codebase doesn't use C++20).
string_view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only libraryProject mention: Is there a std::string::split or something similar? | /r/cpp_questions | 2023-03-13
There are plenty of polyfill libraries that exist for std features like this. I strongly recommend using an existing one that attempts to match the standard closely. For example this one.
expected lite - Expected objects in C++11 and later in a single-file header-only libraryProject 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.
Lightweight Error Augmentation Framework (by boostorg)
Semantic Versioning for modern C++ (by Neargye)
A lightweight C++11-compatible error-handling mechanism (by bitwizeshift)Project mention: Real-world examples of std::expected in codebases? | /r/cpp | 2022-12-11
Example of other people trying to do it in a generic way, as a separate library (instead of in the utility part of some bigger codebase): - https://github.com/bitwizeshift/result - https://github.com/oktal/result - https://github.com/basicpp17/result17 - https://github.com/p-ranav/result
Unicode Algorithms Implementation for C/C++Project mention: uni-algo v0.7.0: constexpr Unicode library and some talk about C++ safety | /r/cpp | 2023-02-07
Safe layer is just bounds checks that work in all cases that I need, before that I was coping with -D_GLIBCXX_DEBUG (doesn't have safe iterators for std::string and std::string_view and that I need the most) and MSVC debug iterators (better but slow as hell in debug). You can read more about the implementation here: https://github.com/uni-algo/uni-algo/blob/main/doc/SAFE_LAYER.md Nothing interesting it's possible to implement all of this even in C++98 but no one cared back then and it's a shame that it's not in C++ standard so we cannot choose to use safe or unsafe std::string for example and must rely on implementations in compilers that are simply incomplete in many cases or implement it from scratch.
A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience. (by aurora-opensource)Project mention: I'm a beginner making a library for unit conversion, contributions are welcome | /r/cpp | 2023-04-21
Be sure to check this one, too https://github.com/aurora-opensource/au
A modern C++ scope guard that is easy to use but hard to misuse.
Boost::ASIO low-level redis client (connector)
ring-span lite - A C++yy-like ring_span type for C++98, C++11 and later in a single-file header-only library
💜 C++ client for InfluxDB.
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
C++ no-dependencies related posts
`DestroyJavaVM()` failing on OpenJ9?
2 projects | /r/javahelp | 22 Apr 2023
[Cpp] Comment testez-vous la couverture du code C ++? Y a-t-il des solutions multiplateforme viables?
1 project | /r/enfrancais | 21 Apr 2023
Is there a std::string::split or something similar?
2 projects | /r/cpp_questions | 13 Mar 2023
If you limit an std::string in a class to be < 15 characters, can you assume that any time the string is read it will stay on the stack due to SSO?
3 projects | /r/cpp | 8 Nov 2022
std::expected (with monadic interface) implementation in C++20 (P0323, P2505)
3 projects | /r/cpp | 5 Jun 2022
GitHub - martinus/svector: Small Vector optimization
2 projects | /r/cpp | 25 May 2022
C++ Return: std::any, std::optional, or std::variant?
1 project | /r/cpp | 20 Sep 2021
A note from our sponsor - Onboard AI
getonboard.dev | 29 Nov 2023
What are some of the best open-source no-dependency projects in C++? This list will help you:
|3||Magic Enum C++||4,058|