TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25169 18
C++26 reflection-based dependency injection

I was playing with reflection and made this (messy) implementation of Guice\-like dependency injection. I worked in a codebase a few years back that was fully Guice-based and it was one of the cleanest and easiest to maintain architectures I've seen. Having it in C++ now is awesome.


https://godbolt.org/z/qrzdrarvr


I'm excited to see all the other interesting things that'll come out of reflection.

https://redd.it/1t9xcln
@r_cpp
More from @r_cpp
  1. Oct 3, 2026Arno Lepisk: Linux shared libraries https://youtu.be/IJASMkkGco8 https://redd.it/1wuvxmh @…
  2. Oct 3, 2026Lets explore the stack https://meetingcpp.com/blog/items/Lets-explore-the-stack.html https…
  3. Oct 3, 2026C++ Show and Tell - October 2026 Use this thread to share anything you've written in C++.…
  4. Oct 3, 2026C++ future at Adobe So if anyone was still curious what happened to Hylo, or where Adobe s…
  5. Oct 3, 2026C++ Jobs - Q4 2026 Rules For Individuals --------------------- * **Don't** create top-leve…
  6. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
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 →