by 112233 · 1y ago · 0 comments
int const<const> auto(decltype(int)) x requires(static) = {{{}}};
And when asked how on earth did this happen and why, there will be the same "we must think about the existing code, the defaults were very poor"Meanwhile they absolutely could make sane defaults when you plonk "#pragma 2033" in the source (or something, see e.g. Baxter's Circle compiler), but where would be the fun of that.
They still use single pass compiling (and order of definitions) as the main guiding principle...
> we must think about the existing code, the defaults were very poor"
What does adding bad features have to do with maintaining defaults?
template<typename T> T&& function_1(remove_reference_t<T> &x) {
return static_cast<T &&>(x);
}
template<typename T> remove_reference_t<T> && function_2(T &&x) {
return static_cast<remove_reference_t<T &&> >(x);
}
Which one is move and which is forward?Now, since all this jenga must remain functional, the only option they have to try and fix stuff that is a complete misfeature (like "this" being a pointer) is either requiring you to write make_this_code_not_stupid keywords everywhere ("explicit", "override", ...), or introduce magic rewriting rules (closures, range for, ...)
some fixes go much lower, "decltype(auto)" being a pinnacle of language design that will unlikely be surpassed.