一、stl_config.h的作用
不同的编译器对C++语言的支持程度不同。而STL作为一个希望具备广泛移植能力的程序库,要支持不同的编译器。
所以STL准备了一个stl_config.h头文件,里面根据使用的不同编译器定义了许多常量,标志是否支持某些C++语言特性,
所有的STL头文件都会直接或间接的包含这个头文件,并以条件式写法,让预处理器根据各个常量决定取舍哪一段代码。
二、stl_config.h注释
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 1997
* Silicon Graphics
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is&
本文主要探讨了STL中的核心文件stl_config.h,详细阐述了其作用,以及文件内部的关键注释,帮助读者理解STL的基础构建。
最低0.47元/天 解锁文章
1753

被折叠的 条评论
为什么被折叠?



