3 ms·
C++ has some contextual keywords as well: final (C++11) override (C++11) import (C++20) module (C++20)
by layer8 3y ago
C++ has some contextual keywords as well:
final (C++11)
override (C++11)
import (C++20)
module (C++20)
- wyldfire 3y agoBut did they make those contextual in order to avoid conflicts with code that had existing identifiers before the new keyword was specified?
- layer8 3y agoYes.
- tsimionescu 3y agoC# is probably the king of contextual keywords, they have tens of them. They started I believe with `yield return` and `yield break` and then added all of the LINQ ones (select, from, where etc), and kept adding others (notnull, record, required, etc).