简体   繁体   English

什么是“ANSI C++”?

[英]What is “ANSI C++”?

I've had someone tell me that C++98 was written under ANSI before being formally standardised as ISO/IEC 14882:1998.有人告诉我,C++98 在正式标准化为 ISO/IEC 14882:1998 之前是在 ANSI 下编写的。

I know that ANSI was involved with C, but I can't seem to find much in the way of proof that the phrase "ANSI C++" is terribly accurate.我知道 ANSI 与 C 有关,但我似乎找不到太多证据证明“ANSI C++”这个短语非常准确。

  • Is "ANSI C++" a good description for C++98? “ANSI C++”是对 C++98 的一个很好的描述吗?
  • Is "ANSI C++" a good description for subsequent versions of the C++ standard? “ANSI C++”是对C++标准后续版本的一个很好的描述吗?

Initially, in '89, the standardization of C++ was handled by ANSI X3J16.最初,在 89 年,C++ 的标准化由 ANSI X3J16 处理。 Starting in '91 ISO WG21 joined in. You may want to read BS's A History of C++:1979-1991 .从 91 年 ISO WG21 开始加入。您可能想阅读 BS 的A History of C++:1979-1991 IMO, "ANSI C++" is just a leftover name; IMO,“ANSI C++”只是一个剩下的名字; the language is "ISO C++" even though ANSI is indirectly involved in the standardization.即使 ANSI 间接参与标准化,该语言也是“ISO C++”。

This gotw page describes the relationship of ANSI and ISO as far as C++ is concerned, briefly:这个gotw页面描述了ANSI和ISO就C++而言的关系,简要说明:

The official names of the ISO and US committees are: ISO 和美国委员会的正式名称是:

ISO/IEC JTC1/SC22/WG21 - C++ (ISO C++ committee) ISO/IEC JTC1/SC22/WG21 - C++(ISO C++委员会)

INCITS PL22.16 - C++ (the US C++ committee, often called the "ANSI C++ committee" -- although more accurately INCITS is a separate organization that is not a part of ANSI but is accredited by ANSI to develop US standards) (previously called X3J16 and J16) INCITS PL22.16 - C++ (the US C++ committee, often called the "ANSI C++ committee" -- although more accurately INCITS is a separate organization that is not a part of ANSI but is accredited by ANSI to develop US standards) (previously called X3J16 和 J16)

These two groups together are often referred to in the singular as "the C++ committee" because they meet and do their work together.这两个团体通常以单数形式被称为“C++ 委员会”,因为他们会面并一起工作。 The meetings are always in the same room at the same time会议总是同时在同一个房间

It sounds like the ISO standard developed by this committee automatically becomes the US standard, although I am sure people who actually work in those committees can explain better.听起来这个委员会制定的 ISO 标准自动成为了美国标准,虽然我相信那些真正在这些委员会工作的人可以更好地解释。

Sort of, but not really.有点,但不是真的。 There isn't, and never has been a separate ANSI standard for C++. C++ 没有,也从来没有单独的 ANSI 标准。

The current standard, however, is actuallyINCITS/ISO/IEC 14882-2003 .然而,当前的标准实际上是INCITS/ISO/IEC 14882-2003 As of 2003, INCITS became a separate ANSI-accredited organization.自 2003 年起,INCITS 成为一个独立的 ANSI 认证组织。 The name INCITS wasn't new, but previously, it had been part of ANSI. INCITS 这个名字并不新鲜,但以前它是 ANSI 的一部分。 In 2003, it was " spun off " as a separate (but still ANSI-accredited) organization. 2003 年,它被“ 分拆”为一个独立的(但仍获得 ANSI 认证的)组织。 The current (2003) standard therefore shows up as an INCITS/ISO/IEC standard, and I believe the upcoming (2011) standard will also.因此,当前的(2003 年)标准显示为 INCITS/ISO/IEC 标准,我相信即将推出的(2011 年)标准也将如此。

C++98 was developed by an international committee, part of the International Organization for Standardization (ISO). C++98 由一个国际委员会开发,该委员会是国际标准化组织 (ISO) 的一部分。 ANSI, and other national standards bodies, are members of this committee. ANSI 和其他国家标准机构是该委员会的成员。 The international standard has been adopted by ANSI as the US national standard, and likewise by many other national standards bodies.该国际标准已被 ANSI 采用为美国国家标准,许多其他国家标准机构也采用该标准。

Earlier versions were developed commercially in the US by AT&T;早期版本由 AT&T 在美国进行商业开发; I'm not sure whether or not ANSI was involved in intermediate versions (EDIT: but Erik's answer suggests that it was, briefly).我不确定 ANSI 是否涉及中间版本(编辑:但 Erik 的回答表明它是简单的)。

Is "ANSI C++" a good description for C++98? “ANSI C++”是对 C++98 的一个很好的描述吗?

I would call it "Standard C++", or "C++98", or just "C++" if it's clear that I'm talking about the current standard.我会称它为“标准 C++”,或“C++98”,或者只是“C++”,如果很明显我在谈论当前的标准。 While technically accurate, "ANSI C++" might confuse people who don't realise that it means the same thing, particularly people from other countries who might not know what ANSI is.虽然在技术上是准确的,但“ANSI C++”可能会让那些没有意识到它的含义相同的人感到困惑,尤其是来自其他国家的人,他们可能不知道 ANSI 是什么。 I would probably get odd looks if I called it "British Standard C++", an equally accurate description.如果我称它为“British Standard C++”,我可能会觉得奇怪,这是一个同样准确的描述。

Is "ANSI C++" a good description for subsequent versions of the C++ standard? “ANSI C++”是对C++标准后续版本的一个很好的描述吗?

Same answer.一样的答案。 The C++ standards are developed by ISO, and adopted by ANSI and other bodies. C++ 标准由 ISO 制定,并被 ANSI 和其他机构采用。

AFAIK when they say "ANSI C++", they really mean "no compiler-specific extensions". AFAIK 当他们说“ANSI C++”时,他们的真正意思是“没有编译器特定的扩展”。

The ISO working party creates the standard. ISO 工作组创建标准。 C++98 had a lot of work done on standardisation in America (because that's where C++ was created, and where its creators lived) before the standardisation was taken under the auspices of the ISO committee (who were the same people).在 ISO 委员会(他们是同一个人)的主持下进行标准化之前,C++98 在美国(因为这是 C++ 的创建地,以及它的创建者居住的地方)在标准化方面做了很多工作。 The final ISO Standard was then adopted by ANSI, and other national standards authorities.最终的 ISO 标准随后被 ANSI 和其他国家标准机构采用。

I've always referred to Standard C++ as "Standard C++".我一直将标准 C++ 称为“标准 C++”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM