Topic: Responses to ~const 1.6: Compiler complexity?
Author: ngo@tammy.harvard.edu (Tom Ngo)
Date: 19 Feb 91 16:43:36 GMT Raw View
Background information to this posting was in a very recent summary.
Anyone who proposes an extension to C++ bears the onus of convincing
the standardization committee that the extension can be implemented
realistically. I have never written a compiler. Those of you out
there who have, what are your reactions to how easily ~const could be
implemented?
My hunch is that it would be quite easy. At present, when the
compiler needs to decide whether an entity x is const, it must descend
a tree from the largest enclosing object to the member containing x,
until it hits a "const" specifier. If it never his a const specifier,
x is not const; otherwise it is.
With ~const, the compiler would not be able to stop at the first const
specifier. Instead, it would have to continue descending the tree,
looking for ~const specifiers, and so on.
Is this wild guess incorrect?
--
Tom Ngo
ngo@harvard.harvard.edu
617/495-1768 lab number, leave message