STL stl_config.h
stl_config.h
. // Filename: stl_config.h
.
. // Comment By: 凝霜
. // E-mail: mdl2009@vip.qq.com
. // Blog: http://blog.csdn.net/mdl13412
.
. /*
8. * Copyright (c) 1996-1997
9. * Silicon Graphics Computer Systems, Inc.
10. *
11. * Permission to use, copy, modify, distribute and sell this software
12. * and its documentation for any purpose is hereby granted without fee,
13. * provided that the above copyright notice appear in all copies and
14. * that both that copyright notice and this permission notice appear
15. * in supporting documentation. Silicon Graphics makes no
16. * representations about the suitability of this software for any
17. * purpose. It is provided "as is" without express or implied warranty.
18. */
.
. /* NOTE: This is an internal header file, included by other STL headers.
21. * You should not attempt to use it directly.
22. */
.
. #ifndef __STL_CONFIG_H
. #define __STL_CONFIG_H
.
. // 本配置文件功能表:
. // (1) 如果不编译器没有定义bool, true, false则定义
. // (2) 如果编译器不支持drand48()函数则定义__STL_NO_DRAND48
. // 注: drand48产生双精度的伪随机数, 因为采用了48bit计算, 故名drand48
. // (3) 如果编译器不支持static members of template classes(模板类静态成员),
. // 则定义__STL_STATIC_TEMPLATE_MEMBER_BUG
. // (4) 如果编译器不支持'typename'关键字, 则将'typename'定义为空(null macro)
. // (5) 如果编译器支持partial specialization of class templates(模板类偏特化),
. // 则定义__STL_CLASS_PARTIAL_SPECIALIZATION
. // 参考文献: http://msdn.microsoft.com/en-us/library/9w7t3kf1(v=VS.71).aspx
. // (6) 如果编译器支持partial ordering of function templates(模板函数特化优先级),
. // 则定义__STL_FUNCTION_TMPL_PARTIAL_ORDER
. // 参考资料: http://msdn.microsoft.com/zh-cn/library/zaycz069.aspx
. // (7) 如果编译器支持calling a function template by providing its template
. // arguments explicitly(显式指定调用模板函数的模板参数)
. // 则定义__STL_EXPLICIT_FUNCTION_TMPL_ARGS
. // (8) 如果编译器支持template members of classes(类模板成员),
. // 则定义__STL_MEMBER_TEMPLATES
. // (9) 如果编译器不支持'explicit'关键字, 则将'explicit'定义为空(null macro)
. // (10) 如果编译器不能根据前一个模板参数设定后面的默认模板参数,
. // 则定义__STL_LIMITED_DEFAULT_TEMPLATES
. // (11) 如果编译器处理模板函数的non-type模板参数类型推断有困难,
. // 则定义__STL_NON_TYPE_TMPL_PARAM_BUG
. // (12) 如果编译器不支持迭代器使用'->'操作符,
. // 则定义__SGI_STL_NO_ARROW_OPERATOR
. // (13) 如果编译器(在当前编译模式下)支持异常,
. // 则定义__STL_USE_EXCEPTIONS
. // (14) 如果我们将STL放进命名空间中,
. // 则定义__STL_USE_NAMESPACES
. // (15) 如果本STL在SGI的编译器上编译, 并且用户没有选择pthreads或者no threads,
. // 则默认使用__STL_SGI_THREADS
. // 注: POSIX thread 简称为pthread, Posix线程是一个POSIX标准线程.
. // (16) 如果本STL在Win32平台的编译器上使用多线程模式编译,
. // 则定义__STL_WIN32THREADS
. // (17) 适当的定义命名空间相关的宏(__STD, __STL_BEGIN_NAMESPACE, 等)
. // (18) 适当的定义异常相关的宏(__STL_TRY, __STL_UNWIND, 等)
. // (19) 根据是否定义__STL_ASSERTIONS, 将__stl_assert定义为断言或者空(null macro)
.
. #ifdef _PTHREADS
. # define __STL_PTHREADS
. #endif
.
. // 如果编译器不提供本STL需要的一些功能,则定义__STL_NEED_XXX
. # if defined(__sgi) && !defined(__GNUC__)
. # if !defined(_BOOL)
. # define __STL_NEED_BOOL
. # endif
. # if !defined(_TYPENAME_IS_KEYWORD)
. # define __STL_NEED_TYPENAME
. # endif
. # ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
. # define __STL_CLASS_PARTIAL_SPECIALIZATION
. # endif
. # ifdef _MEMBER_TEMPLATES
. # define __STL_MEMBER_TEMPLATES
. # endif
. # if !defined(_EXPLICIT_IS_KEYWORD)
. # define __STL_NEED_EXPLICIT
. # endif
. # ifdef __EXCEPTIONS
. # define __STL_USE_EXCEPTIONS
. # endif
. # if (_COMPILER_VERSION >= ) && defined(_NAMESPACES)
. # define __STL_USE_NAMESPACES
. # endif
. # if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
. # define __STL_SGI_THREADS
. # endif
. # endif
.
. # ifdef __GNUC__
. # include <_G_config.h>
. # if __GNUC__ < || (__GNUC__ == && __GNUC_MINOR__ < )
. # define __STL_STATIC_TEMPLATE_MEMBER_BUG
. # define __STL_NEED_TYPENAME
. # define __STL_NEED_EXPLICIT
. # else
. # define __STL_CLASS_PARTIAL_SPECIALIZATION
. # define __STL_FUNCTION_TMPL_PARTIAL_ORDER
. # define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
. # define __STL_MEMBER_TEMPLATES
. # endif
. /* glibc pre 2.0 is very buggy. We have to disable thread for it.
110. It should be upgraded to glibc 2.0 or later. */
. # if !defined(_NOTHREADS) && __GLIBC__ >= && defined(_G_USING_THUNKS)
. # define __STL_PTHREADS
. # endif
. # ifdef __EXCEPTIONS
. # define __STL_USE_EXCEPTIONS
. # endif
. # endif
.
. // Sun C++ compiler
. # if defined(__SUNPRO_CC)
. # define __STL_NEED_BOOL
. # define __STL_NEED_TYPENAME
. # define __STL_NEED_EXPLICIT
. # define __STL_USE_EXCEPTIONS
. # endif
.
. // TODO: 这个我没找到资料, 如果你知道或者有相关资料请联系我, Thank U
. # if defined(__COMO__)
. # define __STL_MEMBER_TEMPLATES
. # define __STL_CLASS_PARTIAL_SPECIALIZATION
. # define __STL_USE_EXCEPTIONS
. # define __STL_USE_NAMESPACES
. # endif
.
. // _MSC_VER 定义微软编译器的版本
. // MS VC++ 10.0 _MSC_VER = 1600
. // MS VC++ 9.0 _MSC_VER = 1500
. // MS VC++ 8.0 _MSC_VER = 1400
. // MS VC++ 7.1 _MSC_VER = 1310
. // MS VC++ 7.0 _MSC_VER = 1300
. // MS VC++ 6.0 _MSC_VER = 1200
. // MS VC++ 5.0 _MSC_VER = 1100
. # if defined(_MSC_VER)
. # if _MSC_VER >
. # include <yvals.h>
. # else
. # define __STL_NEED_BOOL
. # endif
. # define __STL_NO_DRAND48
. # define __STL_NEED_TYPENAME
. # if _MSC_VER <
. # define __STL_NEED_EXPLICIT
. # endif
. # define __STL_NON_TYPE_TMPL_PARAM_BUG
. # define __SGI_STL_NO_ARROW_OPERATOR
. # ifdef _CPPUNWIND
. # define __STL_USE_EXCEPTIONS
. # endif
. # ifdef _MT
. # define __STL_WIN32THREADS
. # endif
. # endif
.
. # if defined(__BORLANDC__)
. # define __STL_NO_DRAND48
. # define __STL_NEED_TYPENAME
. # define __STL_LIMITED_DEFAULT_TEMPLATES
. # define __SGI_STL_NO_ARROW_OPERATOR
. # define __STL_NON_TYPE_TMPL_PARAM_BUG
. # ifdef _CPPUNWIND
. # define __STL_USE_EXCEPTIONS
. # endif
. # ifdef __MT__
. # define __STL_WIN32THREADS
. # endif
. # endif
.
.
. # if defined(__STL_NEED_BOOL)
. typedef int bool;
. # define true
. # define false
. # endif
.
. # ifdef __STL_NEED_TYPENAME
. # define typename
. # endif
.
. # ifdef __STL_NEED_EXPLICIT
. # define explicit
. # endif
.
. # ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
. # define __STL_NULL_TMPL_ARGS <>
. # else
. # define __STL_NULL_TMPL_ARGS
. # endif
.
. # ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
. # define __STL_TEMPLATE_NULL template<>
. # else
. # define __STL_TEMPLATE_NULL
. # endif
.
. // __STL_NO_NAMESPACES is a hook so that users can disable namespaces
. // without having to edit library headers.
. # if defined(__STL_USE_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
. # define __STD std
. # define __STL_BEGIN_NAMESPACE namespace std {
. # define __STL_END_NAMESPACE }
. # define __STL_USE_NAMESPACE_FOR_RELOPS
. # define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
. # define __STL_END_RELOPS_NAMESPACE }
. # define __STD_RELOPS std
. # else
. # define __STD
. # define __STL_BEGIN_NAMESPACE
. # define __STL_END_NAMESPACE
. # undef __STL_USE_NAMESPACE_FOR_RELOPS
. # define __STL_BEGIN_RELOPS_NAMESPACE
. # define __STL_END_RELOPS_NAMESPACE
. # define __STD_RELOPS
. # endif
.
. # ifdef __STL_USE_EXCEPTIONS
. # define __STL_TRY try
. # define __STL_CATCH_ALL catch(...)
. # define __STL_RETHROW throw
. # define __STL_NOTHROW throw()
. # define __STL_UNWIND(action) catch(...) { action; throw; }
. # else
. # define __STL_TRY
. # define __STL_CATCH_ALL if (false)
. # define __STL_RETHROW
. # define __STL_NOTHROW
. # define __STL_UNWIND(action)
. # endif
.
. #ifdef __STL_ASSERTIONS
. # include <stdio.h>
. # define __stl_assert(expr) \
. if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
. __FILE__, __LINE__, # expr); abort(); }
. #else
. # define __stl_assert(expr)
. #endif
.
. #endif /* __STL_CONFIG_H */
.
. // Local Variables:
. // mode:C++
. // End:
STL stl_config.h的更多相关文章
- stl_config.h基本宏
四.宏: (其实呢, 我们所有的宏都包含在了 "stl_config.h"头文件中.) //这些宏是怎么判断是否需要定义:是否有指定的宏,还有一些特定的编译器也可能支持. 4.1. ...
- STL defalloc.h
defalloc.h . // Filename: defalloc.h . . // Comment By: 凝霜 . // E-mail: mdl2009@vip.qq.com . // Blog ...
- STL stl_alloc.h
# // Comment By: 凝霜 # // E-mail: mdl2009@vip.qq.com # // Blog: http://blog.csdn.net/mdl13412 # # // ...
- STL stl_uninitialized.h
stl_uninitialized.h // Filename: stl_uninitialized.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com ...
- STL stl_construct.h
stl_construct.h // Filename: stl_construct.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com // Blog ...
- STL源码剖析——Iterators与Traits编程#5 __type_traits
上节给出了iterator_traits以及用到traits机制的部分函数的完整代码,可以看到traits机制能够提取迭代器的特性从而调用不同的函数,实现效率的最大化.显然这么好的机制不应该仅局限于在 ...
- STL源码剖析—stl_config
操作系统:centos 6.4STL源码版本:3.3 前言: 要看一个项目的源码,首先要选中切入点. 那么在sgi stl 标准库中,其切入点是什么呢? 答案是:stl_config ...
- STL源代码剖析——基本算法stl_algobase.h
前言 在STL中.算法是常常被使用的,算法在整个STL中起到很关键的数据.本节介绍的是一些基本算法,包括equal.fill.fill_n,iter_swap.lexicographical_comp ...
- STL源码标注_空间适配器
/* stl_alloc.h */ SGI STL空间适配器的主要由alloc.h和stl_alloc.h实现 SGI STL空间适配器的核心: 第一级适配器__malloc_alloc_templa ...
随机推荐
- I2C驱动详解
I2C讲解: 在JZ2440开发板上,I2C是由两条数据线构成的SCL,SDA:SCL作为时钟总线,SDA作为数据总线:两条线上可挂载I2C设备,如:AT24C08 两条线连接ARM9 I2C控制器, ...
- CSS中设置div垂直居中
在说到这个问题的时候,也许有人会问CSS中不是有vertical-align属性来设置垂直居中的吗?即使是某些浏览器不支持我只需做少许的CSS Hack技术就可以啊!所以在这里我还要啰嗦两句,CSS中 ...
- Python小白的发展之路之Python基础(三)【函数简介】
目录: 1. 函数基本语法及特性 2. 参数与局部变量 3. 返回值 4.嵌套函数 5.递归 6.匿名函数 7.函数式编程介绍 8.高阶函数 9.内置函数 1. 函数基本语法及特性 首先我们明确函数是 ...
- php 写入数据库时Call to a member function bind_param() on a non-object
<?php $servername = "localhost"; $username = "username"; $password = "pa ...
- spring;maven;github;ssm;分层;timestamp;mvn;
[说明]本来还想今天可以基本搭建一个合适的ssm环境呢,结果发现,,太特么复杂了,网上的例子有好多,看了好多,下面的评论或多或少都有说自己运行产生问题的,搞的我也不敢好好下载运行 [说明]没办法,将目 ...
- hdu_1226超级密码(BFS)
超级密码 Problem Description Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是 ...
- 九度OJ 1335:闯迷宫 (BFS)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1782 解决:483 题目描述: sun所在学校每年都要举行电脑节,今年电脑节有一个新的趣味比赛项目叫做闯迷宫. sun的室友在帮电脑节设计 ...
- 九度OJ 1252:回文子串 (字符串处理、DP)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:387 解决:224 题目描述: 输入一个字符串,输出该字符串中对称的子字符串的最大长度. 比如输入字符串"google" ...
- Action获取表单数据的三种方式
1.使用ActionContext类获取 示例 获取用户提交的用户名和密码 jsp页面 action中的java代码 2.使用ServletActionContext类获取 jsp页面 Java代码 ...
- ThoughtWorks(中国) 程序员读书雷达
ThoughtWorks(中国)程序员读书雷达 软件业的特点是变化.若要提高软件开发的技能,就必须跟上技术发展的步伐.埋首醉心于项目开发与实战,固然能够锤炼自己的开发技巧,却难免受限于经验与学识.世界 ...