home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12920 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.8 KB  |  67 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: disp.h for BC/C++ Yes/No? Where...Al Stevens...*.hpp?
  5. Message-ID: <1992Aug26.180434.8075@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <Bt9J3M.CHL@news.udel.edu> <78400@ut-emx.uucp>
  8. Date: Wed, 26 Aug 1992 18:04:34 GMT
  9. Lines: 56
  10.  
  11. jamshid@ut-emx.uucp (Jamshid Afshar) writes:
  12.  
  13. >>What does "*.hpp" stand for ???
  14.  
  15. >Some C++ programmers use this extension instead of ".h" for their
  16. >header files.  See the c.l.c++ FAQ (ftp sun.soe.clarkson.edu,
  17. >pub/C++/FAQ).  I just use ".h" since there's not much reason to use a
  18. >different extension (you don't 'make' .h files) and I think most C++
  19. >programmers do also.  ANSI C++ will probably use ".h" for any standard
  20. >C++ headers they introduce (confirmation?).
  21.  
  22. Some compilers have used ".hpp", ".hxx", and ".h++" as file extensions
  23. for C++ headers, while others have just used ".h".
  24.  
  25. The Standard will not address the subject of file names, since it is
  26. outside the language.  Like the C Standard, it will just specify the
  27. form of character sequences to be used in #include directives to
  28. access the standard headers.
  29.  
  30. A standard header is not necessarily a file.  If it is a file, the
  31. character sequence appearing in the #include directive might be the
  32. same as the file name, but need not be.
  33.  
  34. Example:  #include <stdlib.h>
  35. 1.  The compiler might recognize this reserved directive and just enable
  36.     declarations internally without ever looking for any actual file.
  37. 2.  There might be a file somewhere called "stdlib.h" which the
  38.     compiler then reads in response to this directive.
  39. 3.  There might be a file somewhere called "etaoin.shrdlu" which the
  40.     compiler then reads in response to this directive.
  41. 4.  There might be a single file somewhere which contains all the
  42.     standard header declarations.  This directive tells the compiler
  43.     to read a certain portion of that file.
  44.  
  45. I believe all of these schemes are currently in use in various compilers.
  46.  
  47. Whether the Standard eventually mandated, for example, <iostream.h>
  48. <iostream.hpp>, <iostream.hxx>, <iostream.h++>, or anything else, it
  49. would make some vendors and users unhappy.  Accordingly, we decided
  50. some time ago that the Standard C++ headers (iostreams, strings, and 
  51. whatever else is standardized) will not have an extension in the
  52. include directive header name.  That is, you will just write
  53.     #include <iostream>
  54. This way we avoid offending only a few, and offend everyone equally :-)
  55.  
  56. I think we can and should word the Standard so that a compiler would
  57. be allowed to accept
  58.     #include <iostream.h>
  59. or
  60.     #include <iostream.hpp>
  61. if it wished, so long as it also accepted
  62.     #include <iostream>
  63. -- 
  64.  
  65. Steve Clamage, TauMetric Corp, steve@taumet.com
  66. Vice Chair, ANSI C++ Committee, X3J16
  67.