Topic: New STD header format (no extension), How


Author: kuehl@uzwil.rz.uni-konstanz.de (Dietmar Kuehl)
Date: 1995/11/19
Raw View
Hi,
Michael Cook (mcook@cognex.com) wrote:
: >>>>> "SC" == Steve Clamage <clamage@Eng.Sun.COM> writes:
:
:  SC> if a compiler previous used <iostream.hxx>, I would expect it to continue
:  SC> to accept <iostream.hxx>, and pick up the same header file as <iostream>.
:
: Wasn't there some rule about `#include <foo>' being treated like `#include
: <foo.hxx>' followed by a bunch of `using' declarations?

Yes, there was some rule "like" this: In clause 'D' which describes
compatibility features (actually in depr.c.headers).  However, this
section _ONLY_ covers headers inherited from C all ending with '.h'.
These header files are also replaced:  'header.h' is replaced by
'cheader' where 'header' stands as a placeholder for any of the C
header files (I first used 'foo' instead of 'header' but it would have
been a misnomer :-) This section does not mandate such a compatibility
header for any of the existing C++ header files.
--
dietmar.kuehl@uni-konstanz.de
http://www.informatik.uni-konstanz.de/~kuehl
I am a realistic optimist - that's why I appear to be slightly pessimistic


---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]





Author: Michael Cook <mcook@cognex.com>
Date: 1995/11/19
Raw View
>>>>> "SC" == Steve Clamage <clamage@Eng.Sun.COM> writes:

 SC> if a compiler previous used <iostream.hxx>, I would expect it to continue
 SC> to accept <iostream.hxx>, and pick up the same header file as <iostream>.

Wasn't there some rule about `#include <foo>' being treated like `#include
<foo.hxx>' followed by a bunch of `using' declarations?

Michael.
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]





Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 1995/11/17
Raw View
In article s2p@stellar.comnet.com, Bret Pehrson <BretP@strata3d.com> writes:
>I have noticed that the new C++ standard library headers do
>not include the traditional '.h' extension.
>
>Does anyone have any insight as to why this is?

Many early C++ implementations used a file extension other than ".h" for
header files. Choices included ".H", ".hpp", ".hxx", ".h++", and perhaps
others. Looking at this problem in 1991, the C++ committee concluded that
enshrining ".h" in the standard would be seen as discriminating against
many implementations.

It is the rule in Standard C that the names of the standard headers used
in angle brackets need not correspond to the name of any file. That is,
when you write <stdio.h>, there need not be any file in the system with
the name "stdio.h". The implementation is free to map the reserved
header name (in angle brackets) to anything -- it need not be a file
at all, for example, but instead the reserved header names could simply
enable declarations predefined inside the compiler. Or the implementation
could map <stdio.h> to a file called "asdfghjkl" if it wished.

The C++ committee decided in 1991 to make this point more obvious by
eliminating the ".h" from the C++ standard header names, thus
discriminating equally against all implementations. :-)  Now you write,
for example, <iostream>, and you might wind up getting a header file whose
name is iostream.h, iostream.H, iostream.hpp, iostream.hxx, iostream.h++,
or "zxcvbnm". (Or perhaps the implementation doesn't use actual files.)

For compatibility, I would expect implementations to continue to accept
the same spelling of standard headers that they always accepted. Thus,
if a compiler previous used <iostream.hxx>, I would expect it to continue
to accept <iostream.hxx>, and pick up the same header file as <iostream>.

---
Steve Clamage, stephen.clamage@eng.sun.com



---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]