Mail Archives: djgpp/2001/05/16/01:00:14
On Wed, 16 May 2001 01:43:46 +0200, "Rafal Maj"
<maj_rafal AT poczta DOT onet DOT pl> wrote in comp.os.msdos.djgpp:
> Hi,
> on comp.lang.c++ all users ara saying, that writting for example :
> #include <iostream.h>
> is an error, and I should use
> #include <iostream>
> When will DJGPP support this ? Have it something to do with GCC 3.0 ?
> Raf256
The very first ever ANSI/ISO International Standard for C++ was
ratified in September 1999. This change was made for two reasons:
There was no standard naming convention for headers on C++ systems.
Most used .h, just like C headers, but others used variations like
.hpp or .hxx, so defining one suffix in the standard would break at
least some code on some compilers.
The second reason is that some of the library functions and features
changed as the language developed, and some functions and classes are
different than they originally were. And finally namespaces were
added to C++.
So the standard committee defined all of the new, standard conforming
C++ headers without any extension at all. They place all of the
types, templates, and functions in the namespace std (and some
namespaces nested inside std) instead of in the global namespace.
This also allows compiler vendors to supply versions of the headers
with the .h extensions that work the old way, for their customers who
do not want to rewrite their code right away or maybe ever, although
this is not required by the standard.
Finally the C++ standard provides two different ways to use standard C
library headers: as before with the .h (like stdio.h, string.h,
time.h), or removing the .h but adding the letter 'c' in front
(cstdio, cstring, ctime).
gcc 2.95.x and 2.96.x do not fully support this feature of C++ and do
not fully support namespaces. This support is supposed to be much
improved in gcc 3.0.
--
Jack Klein
Home: http://JK-Technology.Com
- Raw text -