Hacker News new | ask | show | jobs
by harrid 949 days ago
Reflections alone would be one of the most impactful additions. And in contrast to most others: very difficult to do otherwise. I'm a bit surprised by the sudden push after long phase where it seemed like they would never come.

Contacts: yes please. Variadic indexing is one of those things everyone writes their own helper for. But this standard facility is very welcome indeed.

Some additions seem a bit of of scope for the standard of a language that famously refuses to fix mistakes. So in weary about std::hive, networking, physical units.

And an underrated cherry is at the end: cleaning up those "ill formed, no diagnostic required" clauses in the standard. For those who don't know: there are things forbidden in the standard which the compiler is allowed to not tell you (because it's difficult for the compiler to prove it). In particular this is omnipresent in the constexpr world. Leading to silly redundant code that manually assets things to explicitly trigger the compiler to check for errors.

1 comments

Apparently someone showed up to pick up the work regarding reflection.

However at least we already have a kind of poor man's reflection, with constexpr if + concepts + type traits.

As for the rest, I am also not a big fan, but until my favourite language runtimes and GPGPU tools switch to something else, C++ is part of the toolbox. No need to add even more layers.

Reflection will be a welcome addition whenever it arrives. On the other hand, whatever is standardize will be a profound disappointment compared to Circle C++.
Circle... I hope he can do it. Sounds too good to be true everyone I read about it.
Yeah, Circle is the only "Typescript for C++" alternative.
boost::pfr is also huge for reflection in C++. It leverages corner cases of the language and compilers but does so uniformly (works for MSVC, GCC, clang which is all that matters in 2023).

It allowed me to write for instance https://GitHub.com/celtera/avendish which keeps on giving. The last version even add automatic field name reflection which is huge: https://www.boost.org/doc/libs/master/doc/html/boost_pfr/tut...

Wow, how does this even work? Can you share some hints?
Thanks for the hint, wasn't aware of it.