我在哪里可以在线找到C ++库头文件的源代码?

时间:2021-09-17 04:49:00

Is there a website that can make you look up c++ library header files' source codes online? Such as iostream, vector, map headers' source codes?

有没有一个网站可以让你在线查找c ++库头文件的源代码?如iostream,vector,map headers的源代码?

2 个解决方案

#1


C++ standard itself does not define anything related to implementation, especially when it comes to content of header files. It is totally implementation-specific.

C ++标准本身没有定义任何与实现相关的内容,特别是涉及头文件的内容时。它完全针对具体实施。

  • For LLVM libc++, you can look at this page.
  • 对于LLVM libc ++,您可以查看此页面。

  • In case of GCC, go to this page at GNU project.
  • 如果是GCC,请转到GNU项目的此页面。

  • Microsoft Visual Studio (which includes Visual C++ compiler) has built-in CRT (C(++) Runtime), that is located in VS_INSTALL_FOLDER\VC\crt\src.
  • Microsoft Visual Studio(包括Visual C ++编译器)具有内置的CRT(C(++)Runtime),它位于VS_INSTALL_FOLDER \ VC \ crt \ src中。

But if you want to write portable, standard-compliant, multi-platform applications in C++, the only resource you should rely on is functionality described by the standard, that should be present on every compiler, compatible with its particular version.

但是如果你想用C ++编写可移植的,符合标准的多平台应用程序,你应该依赖的唯一资源就是标准所描述的功能,它应该存在于每个编译器上,与其特定版本兼容。

If you want to become a real C++ developer, you need to become a language-lawyer - someone, who produces code for abstract machine, described by the standard, not follower of specific implementation.

如果你想成为一名真正的C ++开发人员,你需要成为一名语言律师 - 一个为抽象机器生成代码的人,由标准描述,而不是特定实现的追随者。

Platform-specific code should be used only in case of not-yet-standarized features or performance-critical sections, that often can be written more efficiently with OS-specific primitives.

特定于平台的代码仅应用于尚未标准化的功能或性能关键部分,通常可以使用特定于操作系统的原语更有效地编写。

#2


You can checkout this repo for libc++

您可以在libc ++中查看此repo

#1


C++ standard itself does not define anything related to implementation, especially when it comes to content of header files. It is totally implementation-specific.

C ++标准本身没有定义任何与实现相关的内容,特别是涉及头文件的内容时。它完全针对具体实施。

  • For LLVM libc++, you can look at this page.
  • 对于LLVM libc ++,您可以查看此页面。

  • In case of GCC, go to this page at GNU project.
  • 如果是GCC,请转到GNU项目的此页面。

  • Microsoft Visual Studio (which includes Visual C++ compiler) has built-in CRT (C(++) Runtime), that is located in VS_INSTALL_FOLDER\VC\crt\src.
  • Microsoft Visual Studio(包括Visual C ++编译器)具有内置的CRT(C(++)Runtime),它位于VS_INSTALL_FOLDER \ VC \ crt \ src中。

But if you want to write portable, standard-compliant, multi-platform applications in C++, the only resource you should rely on is functionality described by the standard, that should be present on every compiler, compatible with its particular version.

但是如果你想用C ++编写可移植的,符合标准的多平台应用程序,你应该依赖的唯一资源就是标准所描述的功能,它应该存在于每个编译器上,与其特定版本兼容。

If you want to become a real C++ developer, you need to become a language-lawyer - someone, who produces code for abstract machine, described by the standard, not follower of specific implementation.

如果你想成为一名真正的C ++开发人员,你需要成为一名语言律师 - 一个为抽象机器生成代码的人,由标准描述,而不是特定实现的追随者。

Platform-specific code should be used only in case of not-yet-standarized features or performance-critical sections, that often can be written more efficiently with OS-specific primitives.

特定于平台的代码仅应用于尚未标准化的功能或性能关键部分,通常可以使用特定于操作系统的原语更有效地编写。

#2


You can checkout this repo for libc++

您可以在libc ++中查看此repo