by Night_Thastus · 1y ago · 0 comments
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).
using ret_t = first_non_void<decltype(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.
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.
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++.
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.
Which… were never added to C++, right? What a mess.
Personally I would rather have reflect.
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.