top of page

Grupo Così Food

Público·41 membros
Galaktion Subbotin
Galaktion Subbotin

Microsoft Open-sources Its C Standard Library (STL) ((HOT))



Microsoft's implementation of the C++ standard library is often referred to as the STL or Standard Template Library. Although C++ standard library is the official name of the library as defined in ISO 14882, due to the popular use of "STL" and "Standard Template Library" in search engines, we occasionally use those names to make it easier to find our documentation.




Microsoft open-sources its C Standard Library (STL)



From a historical perspective, "STL" originally referred to the Standard Template Library written by Alexander Stepanov. Parts of that library were standardized in the C++ standard library. The standard library also incorporates the ISO C runtime library, parts of the Boost library, and other functionality. Sometimes "STL" is used to refer to the containers and algorithms parts of the C++ standard library adapted from Stepanov's STL. In this documentation, Standard Template Library (STL) refers to the C++ standard library as a whole.


The ISO C standard library is part of the C++ standard library. The Visual C++ libraries that implement the CRT support native code development, and both mixed native and managed code. All versions of the CRT support multi-threaded development. Most of the libraries support both static linking, to link the library directly into your code, or dynamic linking to let your code use common DLL files.


In Visual Studio 2015, the CRT was refactored into new binaries. The Universal CRT (UCRT) contains the functions and globals exported by the standard C99 CRT library. The UCRT is now a Windows component, and ships as part of Windows 10 and later versions. The static library, DLL import library, and header files for the UCRT are now found in the Windows SDK. When you install Visual C++, Visual Studio setup installs the subset of the Windows SDK required to use the UCRT. You can use the UCRT on any version of Windows supported by Visual Studio 2015 and later versions. You can redistribute it using vcredist for supported versions of Windows other than Windows 10 or later. For more information, see Redistributing Visual C++ Files.


When the UCRT was refactored, the Concurrency Runtime functions were moved intoconcrt140.dll, which was added to the C++ redistributable package. This DLL is required for C++ parallel containers and algorithms such as concurrency::parallel_for. In addition, the C++ standard library requires this DLL on Windows XP to support synchronization primitives, because Windows XP doesn't have condition variables.


This version of the CRT isn't fully conformant with the C99 standard. In versions before Visual Studio 2019 version 16.8, the header isn't supported. In all versions, the CX_LIMITED_RANGE and FP_CONTRACT pragma macros aren't supported. Certain elements such as the meaning of parameter specifiers in standard IO functions use legacy interpretations by default. You can use /Zc compiler conformance options and specify linker options to control some aspects of library conformance.


When you build a release version of your project, one of the basic C runtime libraries (libcmt.lib, msvcmrt.lib, msvcrt.lib) is linked by default, depending on the compiler option you choose (multithreaded, DLL, /clr). If you include one of the C++ standard library header files in your code, a C++ standard library will be linked automatically by Visual C++ at compile time. For example:


For binary compatibility, more than one DLL file may be specified by a single import library. Version updates may introduce dot libraries, separate DLLs that introduce new library functionality. For example, Visual Studio 2017 version 15.6 introduced msvcp140_1.dll to support more standard library functionality without breaking the Application Binary Interface (ABI) supported by msvcp140.dll. The msvcprt.lib import library included in the toolset for Visual Studio 2017 version 15.6 supports both DLLs, and the vcredist for this version installs both DLLs. Once shipped, a dot library has a fixed ABI, and will never have a dependency on a later dot library.


The C++ Standard Library: A Tutorial and Reference by renowned ISO C++ member Nicolai Josuttis is the most respected book for learning and studying the standard library. It provides comprehensive documentation of each library component, including an introduction to its purpose and design; clearly written explanations of complex concepts; the practical programming details needed for effective use; traps and pitfalls; the exact signature and definition of the most important classes and functions;