It feels like I'm looking at a conlang instead of C++.
Not hating the author, I'm sure they know their stuff and this is useful to someone. Just looking at this from the perspective of an ordinary C++ programmer, it looks very alien.
It feels like I'm looking at a conlang instead of C++.
Not hating the author, I'm sure they know their stuff and this is useful to someone. Just looking at this from the perspective of an ordinary C++ programmer, it looks very alien.
I had the impression that the vast majority of us regular users just wanted quality of life improvements: better error messages, networking library, a standard package manager etc. Literally most of what C++ code styles are concerned with is about picking what features are banned in that particular style.
But instead of doing something pratical, the commitee always went with the route of adding increasingly niche features citing that useful things are "out of scope" or "implementation defined" or "userspace".
So what you get is incompatible ecosystems and cultures for an extremely complicated language.
Very happy working with Go presently, where exactly the opposite approach is being taken by maintainers. Eg: There was huge pushback regarding generics introduction (a genuinely useful language feature IMO), but they introduced very good vulnerability scanning (govulncheck) without me even hearing about it being under development.
But my point is that niche (in my opinion) features seem to be getting into the standard much more often than things that are broadly useful (in my opinion).
With C++26 we're barely getting to where python was already in 2001 with the introduction of decorators or Java in 2004 with annotations. C# had these features from the very beginning (albeit at runtime, not compile-time like C++).
How is it okay that newly added language features end up unused/deprecated/discouraged, but it's a problem for libraries?
I never got to try exceptions and modules in C++.
Exceptions because every place I worked at banned them, and modules because they were not implemented by the time I left the language.
I'm 100% sure that people got (and will keep getting) much more value out of unfortunate std::regex and std::fstream than they will ever get from reflection (in the few places that will even allow using it at all).
Everywhere I worked we also had custom ad-hoc reflection/code synthesis, usually via preprocessing. We would have replaced with a builtin solution in an heartbeat.
you work likely in a very specific niche as no language feature has ever been entirely banned in the places I've been to. There are hundreds of thousands of codebases happily using exceptions in C++. https://github.com/search?q=%22throw+std%3A%3Aruntime_error%... as well as any other feature you can imagine.
using ret_t = first_non_void<decltype(fnc.template operator()<Elts>())...>;constexpr void operator>>(F fnc) const { (fnc.template operator()<Elts>(), ...); }
``` void print_members(T const& obj) { [:expand(nonstatic_data_members_of(^^T)):] ```
What is this ^^?
However many of us would have prefered reflect(T), but again many on WG21 seem to use notepad for programming and don't like to type.
It means the reflection data of the type.
Which… were never added to C++, right? What a mess.
Personally I would rather have reflect.
Why does that matter?
> many of us would have prefered reflect(T), but again many on WG21 seem to use notepad for programming and don't like to type.
I don't know about anyone else, but I find reflect(T) much easier to type than ^^T. I have a high error rate on hitting 6. Not only that I have to move my hand from the home row to hit it.
Ultimetely that is how ISO driven languages work, features get decided by those willing to join the process, and vote on what features become part of the next language standard.
https://github.com/search?q=lang%3AObjective-C%2B%2B+&type=r...
all of those would instantly break.
I develop a C++ / Qt software that also ships on macOS and some parts of the macOS API are only realistically useable from Obj-C / Obj-C++ so any C++ software that wants deeper integration with the OS there must work with Objective-C++.
I think C++26's reflection is likely to be one of the most important changes to the language in a very long time.
Still a reflect keyword could have worked. Some argued that in reflection heavy code you would reflect a lot and the keyword would be a lot of noise.
I don't know if the reflection papers have been voted in already (I forgot how to check), so the syntax might still be up for debate.
> The original TS landed on reflexpr(...) as the syntax to reflect source constructs and [P1240R0] adopted that syntax as well. As more examples were discussed, it became clear that that syntax was both (a) too “heavy” and (b) insufficiently distinct from a function call. SG7 eventually agreed upon the prefix ^ operator. The “upward arrow” interpretation of the caret matches the “lift” or “raise” verbs that are sometimes used to describe the reflection operation in other contexts.