You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import has become a keyword in C++20. Curiously, the authors of the standard have chosen it to be a "context-sensitive keyword" so that it only acts as something related to modules if at the global scope and in certain situations where it could not have been used as the name of a class or function. One may have philosophical qualms about this, but it is what it is.
We should nevertheless think about whether we want to continue using this name. I suspect that the use of the keyword would confuse IDEs and, possibly, readers. I found ~90 uses of the word in our code base (see below). Some should be relatively easy to address if they are just local variables, but some are also member functions -- specifically in the parallel vector interfaces. Maybe we could name these functions import_elements()?
(There is the related question of using module, which is also a context-sensitive keyword in C++20. But we don't seem to be using this name outside the documentation.)
import
has become a keyword in C++20. Curiously, the authors of the standard have chosen it to be a "context-sensitive keyword" so that it only acts as something related to modules if at the global scope and in certain situations where it could not have been used as the name of a class or function. One may have philosophical qualms about this, but it is what it is.We should nevertheless think about whether we want to continue using this name. I suspect that the use of the keyword would confuse IDEs and, possibly, readers. I found ~90 uses of the word in our code base (see below). Some should be relatively easy to address if they are just local variables, but some are also member functions -- specifically in the parallel vector interfaces. Maybe we could name these functions
import_elements()
?(There is the related question of using
module
, which is also a context-sensitive keyword in C++20. But we don't seem to be using this name outside the documentation.)List of places where we seem to be using
import
:The text was updated successfully, but these errors were encountered: