@ericniebler@CppSage We have a syntax for that already... You put x in the angle brackets instead of the parens
template<int x> consteval int fun() {...}
Carbon, a successor language to C++ was announced at @CppNorth today by @chandlerc1024.
I'm very excited about this project's potential. You can learn more about Carbon and get involved on GitHub.
https://t.co/p4UIBB6Irx
@apardoe @rodgertq @lefticus@olafurw@PatriceRoy1@tvaneerd To be clear, I'm not saying it's necessarily a big job, it's more that I lack experience in hacking on compilers. The paper does have a gc-like aspect to it though, which could make things interesting.
@bjorn_fahller@hankadusikova@shafikyaghmour What hana said... https://t.co/A1DiljnQc9 is the paper that replaced the comparison-based test with the public members requirement, so the rationale you're looking for should be in there
@taralx@shafikyaghmour For X<C, "hi"> to non-surprising, it'd have to be the same type every time you write it. But the template argument is a pointer value, so "hi" would need to be the same pointer every time it's written. And that isn't guaranteed.
@shafikyaghmour Finally, one of these I can answer with confidence! And all I needed to do was be the person who proposed the relevant C++20 feature. Still had to think for a minute about whether we also merged Louis' paper in the end.