home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!relay.cs.toronto.edu!compuserve.com!76336.3114
- Newsgroups: comp.lang.c++
- From: 76336.3114@CompuServe.COM (Kevin Dean)
- Subject: Standard library functions and macros
- Message-ID: <921231032705_76336.3114_EHJ60-1@CompuServe.COM>
- Date: 31 Dec 92 03:33:02 GMT
- Lines: 37
-
- Date: 12-23-92 (20:14) Number: 3022 of 3071
- To: ALL Refer#: NONE
- From: JIM ADCOCK Read: (N/A)
- Subj: STANDARD LIBRARY FUNCTION Status: PUBLIC MESSAGE
- Conf: U-COMPLANGC++ (3870) Read Type: GENERAL (+)
-
- In an article dated 12-23-92, Jim Adcock (jimad@microsoft.com) writes:
-
- >I'd counterpropose why don't we all just *leave prior standards alone*
- >unless we have overwhelming reasons to change them. The standard library
- >function names in C are reserved. Leave them reserved, and leave them
- >their C "meanings". There is no more reason why C++ people ought to be
- >dinking with these reserved words than any of the other reserved words
- >from C, such as "for" "if" "else" "struct" etc.
-
- Why should function names be reserved? They are functions, after all, and
- are thus outside the definition of the language. If they have to be
- overridden or defined as macros, can't they just be inlined? Off the top
- of my head, I can only think of the assert() macro that couldn't be
- rewritten as an inline function because it has to dump context-sensitive
- information like file and line number if it's to be of any use.
-
- The reason I say this is that reserving the function names can make for
- severe maintenance headaches. Suppose I have a class that has member
- functions read() and write() and the C-standard read() and write() have
- been redefined as macros by the compiler. What then? The member
- functions get replaced by the macros and my class goes out to lunch. I
- have now lost the use of two very useful and meaningful names (I've had
- this happen, though not with read() and write()).
-
- Kevin Dean
-
- SNAG: acronym for Sensitive New-Age Goof, one who, without any relevant
- experience, is always willing to enlighten the ignorant masses on the
- social issue of the day. Have you hit any SNAGs lately?
-
-
-