C++26 Reflection loves QRangeModel

https://www.qt.io/blog/c26-reflection-qrangemodel

Comments

mcdeltatJan 25, 2026, 4:46 AM
I've been an avid C++ user for ages and this is the first time I've seen the final spec of C++26 reflections used in a practical context - and wow am I having a "wtf" moment at the syntax.

^^T ?? obj.[:member:] ?? What is this craziness? No way this is the best we could come up with. I'm actually thinking C++ may be going too far (and this is as someone who thinks template metaprogramming is "fine").

Never before has that quote "inside C++ is a smaller, better language trying to get out" been more applicable.

pjmlpJan 25, 2026, 9:41 AM
While I agree it has a certain Perl feeling and I used to advocate for functions/operators, e.g. reflex or similar, it still feels better than unicode operators in FP languages or the two macro systems used by Rust.

At least being based on compile time execution infrastructure means you can debug it on IDEs, Clion already has some work into that direction.

https://blog.jetbrains.com/clion/2025/09/introducing-constex...

psyclobeJan 26, 2026, 1:53 AM
Eh, the raw capability of this feature will I think prove its use
fleshmonadJan 24, 2026, 8:50 PM
It's all so tiresome
kvemkonJan 24, 2026, 6:25 PM
TLDR:

> Reflection in C++26 might be insufficient for replacing moc.

https://wiki.qt.io/C++_reflection_(P2996)_and_moc

PaulDavisThe1stJan 24, 2026, 7:19 PM
> NOTE: THIS HAS BEEN WRITTEN AGAINST A VERY EARLY REVISION OF P2996. MANY THINGS HAVE CHANGED SINCE, AND EVERYTHING ON THIS PAGE NEED TO BE RE-EVALUATED BASED ON WHAT EFFECTIVELY LANDED IN C++26!
kvemkonJan 24, 2026, 9:42 PM
Taken from bookmarks, haven't noticed this before. Looking forward for the article update.
themafiaJan 24, 2026, 8:30 PM
It this even a language for human beings anymore? Or am I just short on cups of coffee this morning?

I appreciate that they're solving a lot of corner cases and adding some advanced functionality in the spec but now we've got language text that looks quite a bit like perl. I wonder if it will acquire some of the same properties.

pjmlpJan 25, 2026, 9:42 AM
Until something else takes over the domains where C++ rules, it is what we have, even the crustacean compiler is built on top of C++ infrastructure (LLVM/GCC).
funkychickenJan 25, 2026, 2:53 AM
Most users would not need to use it. But it is invaluable for library/framework authors (like qt).