2 ms·
> although of course unlike C++ Rust actually can just take new keywords anyway, because it has a way to spell identifiers that are now keywords C and C++ intr
by rightbyte 5y ago
> although of course unlike C++ Rust actually can just take new keywords anyway, because it has a way to spell identifiers that are now keywords
C and C++ introduce new keywords all the time, by prefixing them with "_" and a capital letter. If you want the nice spelling you need to use a header. E.g. "_Complex". "co_await" etc are operators.
- tialaramex 5y agoIt's possible you're one of the two kinds of "C/C++ programmers" and so you've assumed that since this is how C prefers to introduce things it must be how C++ does it too, but not so. C++ 20 introduced concepts. In C++ 17 "concept" is a perfectly reasonable name for an identifier. Maybe it's a class, a variable, a free function, all fine. In C++ 20 that's a reserved word and can't be used as an identifier. Rust does not have this problem, a 2015 function named "await" is somewhat annoying to use from Rust 2018 or later where "await" is a keyword, but it's only annoying it isn't actually difficult.