>>107780412
Nothing I wrote implies two type systems.
>>107783674
No. No macros. Just literally have a properly designed type system with higher order kinds or functors. Semantically C++ has this, but in practice it's a royal pain in the ass to use where there are weird limitations over basic things because it's a slap-dash piece of crap cobbled together over decades. It's powerful, but poorly designed. Qualifier dropping, bad decisions in the deduction rules, etc. You can do a lot with templates, but actually utilizing that power is a game of pulling teeth.
Qualifier dropping is easily one of the stupidest, most asinine decisions that the language went with. A thousand curses on the standards committee for this shit.
template <typename T>
void overwrite(T ptr) {
*ptr = 99;
}
const int x = 42;
const int* px = &x;
overwrite(px);
It can't even handle this deduction case:
template <typename T>
void printTwice(T* ptr) {
std::cout << *ptr << " " << *ptr << "\n";
}
int x = 42;
printTwice(&x);
Speaking of the shitty deduction rules, a trivial case that sepples can't handle:
template <typename T>
auto half(T x) -> decltype(x / 2) {
return x / 2;
}
auto y = half(10);
Templates are a classic case of the 85/15 rule. They're 85% of the way to being a decent language feature, and the missing 15% makes them effectively an anti-pattern. The fact so many C++ users avoid them like the plague is a stronger indictment than I could hope to concoct.