Thread View: comp.std.c++
1 messages
1 total messages
Started by Steven Kearns
Sat, 23 Feb 1991 04:42
local type names
Author: Steven Kearns
Date: Sat, 23 Feb 1991 04:42
Date: Sat, 23 Feb 1991 04:42
31 lines
1785 bytes
1785 bytes
I am mystified by the logic behind the rule in ARM 9.9, p. 190, that says " "you cannot redefine a name inside a class to be a typedefname or classname if it has already been used by a previous declaration in the class. " This is bad on general principles: i.e. it gives an exception to the general rule for interpreting names. Also, it does not really lessen the burden on compiler writers, since now they have to check, every time a classname or typedefname is declared in a class, that the name was not previously USED. It doesnt simplify the interpretation of inline functions, since these have to be interpreted, at least semantically, at the end of the class declaration, in which case there is no confusion about what the name refers to. Also, why are declarations of typedefnames and classnames (mis)treated thusly, but not variables or functions? I agree that it is poor style to access a name inside a scope, and then to redefine the name, however I doubt that it is worth it to make a special rule to prevent this. (I believe it would rarely occur in programs found "in the wild".) However, if such a rule is instituted, at least extend it to all names! ******************************************************** * Steven Kearns ....uunet!softrue!kearns * * Software Truth softrue!kearns@uunet.uu.net * ********************************************************
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads