什么是ANSI-C ++

什么是ANSI-C ++?
ANSI-C++ is the name by which the international ANSI/ISO standard for the C++ language is known. But before this standard was published, C++ was already widely used and therefore there is a lot of code out there written in pre-standard C++. Referring to ANSI-C++ explicitly differenciates it from pre-standard C++ code, which is incompatible in some ways.
ANSI-C ++是C ++语言的国际ANSI / ISO标准已知的名称。但是,在这个标准发布之前,C ++已经被广泛使用,因此在标准C ++中编写了很多代码。引用ANSI-C ++明确地将它与预标准的C ++代码区分开来,这在某些方面是不兼容的。

#include <iostream>
using namespace std;
template <class T>
bool ansisupported (T x) { return true; }

int main() {
  if (ansisupported(0)) cout << "ANSI OK";
  return 0;

If your compiler is able to compile this program, you will be able to compile most of the existing ANSI-C++ code.

发布了42 篇原创文章 · 获赞 6 · 访问量 9816


©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客