POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x : Re: Beta 37 and C++0x Server Time
2 Jul 2024 14:38:47 EDT (-0400)
  Re: Beta 37 and C++0x  
From: Warp
Date: 5 Jun 2010 07:50:34
Message: <4c0a3a09@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> On 05.06.10 12:51, Warp wrote:
> >> D.5 Standard C library headers [depr.c.headers]
> >> 2 Each C header, whose name has the form name.h, behaves as if each name
> >> placed in the Standard library namespace by the corresponding cname header
> >> is also placed within the namespace scope of the namespace std and is
> >> followed by an explicit using declaration (7.3.3)
> >
> >> LOL, the bad, bad standard uses "using declarations" for whole files. How
> >> can those amateurs dare!
> >
> >    Perhaps you don't understand what "compatibility" and "deprecated" mean?
> >
> >    In English those words mean in this context "compilers should implement
> > .h versions of standard header files for compatibility with code written
> > for pre-standard C++ compilers, but these headers should be considered
> > deprecated and might be removed at any time in the future".

> Written for "pre-standard C++ compilers" - LOL. Seems you missed that C++ is 
> not a successor to the ISo C standard. That standard is well defined and 
> quite actively developed: <http://www.open-std.org/jtc1/sc22/wg14/> . But 
> hey, what do I know, I don't even speak English.

  I can't believe I have to explain this to you, even though you know this
perfectly well.

  C++ was first developed by Stroustrup in 1983. C++ compilers began to
appear, each one implementing Stroustrup's language specification plus a
bunch of their own extensions, mostly in the form of libraries. These
libraries were in no way standardized and there was a wide variety of them.
These included all of the C standard libraries and compiler-specific C++
libraries.

  By 1994 one set of libraries, which would later be known as the STL,
became popular and widespread in many compilers due to their versatility.

  Back then there was no namespace support in many compilers, and a common
idiom was to have eg. a <vector.h> header file which declared the 'vector'
data container in global namespace. These got into widespread use.

  It was not until 1998 (15 years after the language was invented and
compilers started appearing) that the language was standardized. The
standardization committee decided that all standard libraries should
use the 'std' namespace instead of declaring everything in the global
namespace.

  Of course there was a minor practical problem then: In 1998 there were
tons and tons of C++ programs written for pre-standard C++ compilers. In
other words they used the <something.h> style of headers and assumed that
the names were in global namespace.

  To alleviate this practical problem the standarization committee decided
to declare that compilers could preserve their <something.h> headers and
make them work as previously (iow. they declare everything in the global
namespace), but the new standard headers should be of the form <something>
and declare everything in the 'std' namespace instead.

  The support for the old <something.h> style headers was added for
compatibility with existing compilers only, and marked as a deprecated
feature right from the start (in other words, new C++ code should not
assume that these headers will exist forever).

  So yes, written for pre-standard C++ compilers. No LOL. There existed
tons of compilers before C++ was standardized, and there was lots and lots
of code written for those compilers.

  Now, could you please explain what you meant with "seems you missed that
C++ is not a successor to the ISo C standard. That standard is well defined
and quite actively developed", and how it's relevant to what I wrote?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.