Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!think.com!hsdndev!husc6!ngo From: ngo@tammy.harvard.edu (Tom Ngo) Newsgroups: comp.std.c++ Subject: Responses to ~const 1.6: Compiler complexity? Message-ID: Date: 19 Feb 91 16:43:36 GMT Sender: news@husc6.harvard.edu Distribution: comp Organization: Harvard Chemistry Department Lines: 24 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