Loading…
Thursday September 17, 2026 16:45 - 17:45 MDT
C++26 reflection was designed so that it could open doors that have been shut since the creation of the language. One of the most firmly bolted doors — type erasure — can be broken down by pushing our new code generation capabilities to their limit. Introducing duck, an open-source library built to harness this new power.

So far, reflection gives us just one function to generate code: define aggregate, which lets you build a simple type. duck uses define aggregate to generate a vtable, transforming a tool for building simple types into one that builds interfaces. You declare an interface as an ordinary struct of C++ function declarations. Plug any type that already has those functions into duck, and you can dynamically call it with plain duck.quack() syntax — no inheritance, adapters, or macros required. This means you can avoid handwriting simply to connect other pieces of code. State what a capability means, and everything you already own that does it is compatible — your types, a vendor's, generated ones, a fifteen-year-old module nobody wants to reopen.

Through this talk, you will learn the basics of code generation with reflection, grounded entirely in real stories from duck's implementation. We'll look at where existing approaches struggle, how duck solves these historic problems, and the central technique: using define_aggregate to both synthesize a vtable and simulate member function call syntax.

We'll end by looking at the future of type erasure: the C++29 proposal for std::protocol, how token injection can perfect the implementation of duck, and how you can help push the frontier of reflection.

Presenters
RK

Ryan Keane

Ryan Keane is a second-year computer science student at Rensselaer Polytechnic Institute and the creator of duck, a C++ reflection library for non-intrusive interfaces. After writing a blog post about the library's internals, he was invited to speak at CppCon and is now collaborating... Read More →
Thursday September 17, 2026 16:45 - 17:45 MDT
Red Rock 6/7

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Share Modal

Share this link via

Or copy link