Arthur O'Dwyer
Read post

C++26 Reflection gives us universal template parameters

C++26 Reflection introduces a single opaque type `std::meta::info` that can represent any language entity — types, class templates, values, and more. This turns out to give us 'universal template parameters' almost for free: a single function template parameterized on `meta::info` can accept `std::vector<int>`, `std::vector`, `std::ranges::subrange`, or any other template argument, something previously impossible without combinatorial overload sets. The post demonstrates this with a `meta_to` example and suggests that the dedicated P2989 'Universal template parameters' proposal may now be redundant.

    #c++
Jun 08•3m read time•From quuxplusone.github.io
Post cover image
3.2K Impressions
Arthur O'Dwyer's image
Arthur O'Dwyer

Authored by Arthur O'Dwyer, Quuxplusone offers explorations of C++ programming language features, s...

8 Followers

•

125 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard