r/cpp • u/Acrobatic-Stable2537 n0F4x • Jun 25 '26
C++23 Dependency Injection library with automatic dependency building
I open-sourced my dependency injection library.
Link: https://github.com/n0F4x/redi
This was developed for my game engine.
- feature-rich dependency configuration
- optimized for fast compile time
- helpful error messages when a cyclic dependency is detected
- dependencies are automatically constructed - no need to register them by hand
I am giving this project to the community so that everybody can benefit. This kind of approach is mostly useful when dealing with intricate systems, such as a plugin system. I welcome all kinds of feedback, as this was mostly a learning opportunity for me. If you'd like to use this in your project but don't have access to the required compiler features, let me know, and I'll see if I can reduce the requirements.
View all comments
Show parent comment
3
u/gracicot Jun 26 '26
Have you ever worked in a database engine, a compiler or a web engine? I came up with those three examples that I'm sure are far larger than the project I'm working in, feel free to check the size.
I think you underestimate the scale of code for popular and essential projects like those.
Also I wouldn't want ever working in a codebase with no class types. Structs are class types and are just essential, even in a codebase with mostly functions and procedures.