Sujet : Re: Pre-main construction order in modules
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.c++Date : 01. Apr 2025, 23:57:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vshr0o$6kba$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 4/1/25 16:10, Michael S wrote:
On Tue, 1 Apr 2025 13:55:43 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
...
No, that does not. The standard was never intended as a description of
how compilers actually work, it was always intended to be a
description of requirements on how they should work.
It sounds to me like a revisionisms.
Most language standards are intended to codify commonalities of work of
existing compilers. That applies to C++98 and mostly, although not
completely, to the following C++ standards.
Regardless of whether they codify existing implementations or innovate
far beyond them, programming language standards are codifications - and
that makes them prescriptive documents. The C++ standard exists to
define what it means to be a conforming implementation of C++, and what
it means to write well-formed code. Well-formed code translated by a
conforming implementation of C++ will produce the behavior that meets
the requirements specified by the standard - and that's the point of the
standard.
However, C++98 was in fact notorious for the extent to which it went
beyond merely codifying existing practice. In particular, <iostream> was
a big change from <iostream.h>, and the process of incorporating STL
into the C++ standard library involved a lot of changes.
And every revision to the C++ standard has increased C++'s reputation
for innovating well beyond existing practice. The language defined by
the latest standard is very different from the one defined by C++98.
The other standard that I'm most familiar with, the C standard, is by
comparison a very slowly changing standard - but C90, C99, and C2011
were all pretty significant changes from existing practice.