TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25500 15
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.


https://redd.it/1uf9pcf
@r_cpp
GitHub GitHub - n0F4x/redi: An automatic dependency injection library An automatic dependency injection library. Contribute to n0F4x/redi development by creating an account on GitHub.
More from @r_cpp
  1. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  2. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  3. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
  4. Sep 20, 2026A clever branch free optimization I'm the developer of memlz which is an extremely fast co…
  5. Sep 15, 2026Inside Boost.PolyCollection https://bannalia.blogspot.com/2026/09/inside-boostpolycollecti…
  6. Sep 11, 2026C++26: Standard Library Hardening Experiments https://www.cppstories.com/2026/hardening-ex…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →