Beautiful Type Erasure with C++26 Reflection and rjk::duck

Beautiful Type Erasure with C++26 Reflection

3RyanJK5💬 1

I built rjk::duck to solve the pain of complex type erasure by leveraging C++26 reflection. Instead of writing hundreds of lines of fragile code or relying on heavy libraries, you can now declare an interface once and let the compiler handle the rest. This single-header library uses new language features to generate vtables and resolve overloads automatically, offering high performance and full customization with minimal boilerplate.

"We're talking about the bleeding edge here, so right now support is only available for gcc with -std=c++26 -freflection."

More from this day · 2026-07-14