以下信息摘自与标准C++的文档中。

如果把这些宏加在程序的日志中,它将为开发人员进行问题分析提供了很好的帮助。

standard c++ 1998版
The following macro names shall be defined by the implementation:
__LINE__ The line number of the current source line (a decimal constant).
__FILE__ The presumed name of the source file (a character string literal).
__DATE__ The date of translation of the source file (a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10). If the date of translation is not available, an implementationdefined valid date is supplied.
__TIME__ The time of translation of the source file (a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function). If the time of translation is not available, an implementationdefined valid time is supplied.
__STDC__ Whether __STDC__ is predefined and if so, what its value is, are implementationdefined.
__cplusplus The name __cplusplus is defined to the value 199711L when compiling a C++ translation unit.

standard c++ 2011版
1 The following macro names shall be defined by the implementation:
__cplusplus
The name __ cplusplus is defined to the value 201103L when compiling a C++ translation unit.
__DATE__
The date of translation of the source file: a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not
available, an implementation-defined valid date shall be supplied.
__FILE__
The presumed name of the current source file (a character string literal).
__LINE__
The presumed line number (within the current source file) of the current source line (an integer constant).
__STDC_HOSTED__
The integer constant 1 if the implementation is a hosted implementation or the integer constant 0 if it is not.
__TIME__
The time of translation of the source file: a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function. If the time of translation is not available, an implementationdefined valid time shall be supplied.
2 The following macro names are conditionally defined by the implementation:
__STDC__
Whether __STDC__ is predefined and if so, what its value is, are implementation-defined.
__ STDC_MB_MIGHT_NEQ_WC__
The integer constant 1, intended to indicate that, in the encoding for wchar_t, a member of the basic character set need not have a code value equal to its value when used as the lone character in an ordinary character literal.
__STDC_VERSION__
Whether __STDC_VERSION__ is predefined and if so, what its value is, are implementation-defined.
__STDC_ISO_10646__
An integer constant of the form yyyymmL (for example, 199712L). If this symbol is defined, then every character in the Unicode required set, when stored in an object of type wchar_t, has the same value as the short identifier of that character. The Unicode required set consists of all the characters that
are defined by ISO/IEC 10646, along with all amendments and technical corrigenda as of the specified year and month.
__STDCPP_STRICT_POINTER_SAFETY__
Defined, and has the value integer constant 1, if and only if the implementation has strict pointer safety.
__STDCPP_THREADS__
Defined, and has the value integer constant 1, if and only if a program can have more than one thread of execution.

C++中预定义的宏的更多相关文章

  1. visual c++中预定义的宏

    一.主要目标 (由于visual studio通常包含很多开发环境,通常将其中c/c++的ide称为visual c++ 20xx) 整理下visual c++ 2010下预定义的宏.做一下备忘和了解 ...

  2. gcc中预定义的宏__GNUC__

    转载:gcc中预定义的宏__GNUC__ - Cccarl - 博客园 (cnblogs.com) 今天在看Linux系统编程这本书的代码的时候看到了__GNUC__,不太清楚这个宏所以去查了一下,以 ...

  3. ARM编译器中预定义的宏

    arm系列目前支持三大主流的工具链,realview的armcc,iar ewarm的iccarm,gnu的gcc,编译器在编译的时候会预定义一些宏,这些宏在工程中起到不可或缺的作用. 例如 /* d ...

  4. C标准中一些预定义的宏

    C标准中指定了一些预定义的宏,对于编程经常会用到.下面这个表中就是一些常常用到的预定义宏. 宏(双下滑线) 意义 __DATE__ 进行预处理的日期(“Mmm dd yyyy”形式的字符串文字) __ ...

  5. C标准中一些预定义的宏,如__FILE__,__func__等

    C标准中一些预定义的宏 C标准中指定了一些预定义的宏,对于编程经常会用到.下面这个表中就是一些常常用到的预定义宏. 宏 意义 __DATE__ 进行预处理的日期(“Mmm dd yyyy”形式的字符串 ...

  6. VS2013 预定义的宏

    Visual Studio 2013 预定义的宏 https://msdn.microsoft.com/zh-cn/library/b0084kay(v=vs.120).aspx 列出预定义的 ANS ...

  7. 2019-8-31-dotnet-新项目格式与对应框架预定义的宏

    title author date CreateTime categories dotnet 新项目格式与对应框架预定义的宏 lindexi 2019-08-31 16:55:58 +0800 201 ...

  8. dotnet 新项目格式与对应框架预定义的宏

    在 sdk style 的项目格式支持使用多框架开发,此时需要在代码里面通过宏判断,在编译的时候执行不同的代码.本文告诉大家在框架里面对应的预定义的条件编译符有哪些 在让一个 csproj 项目指定多 ...

  9. 五个在XML文档中预定义好的实体

    下面是五个在XML文档中预定义好的实体: < < 小于号 > > 大于号 & & 和 &apos; ' 单引号 " " 双引号 实体 ...

随机推荐

  1. selenium网页没加载完成就停止加载并自动刷新

    判断一个网页10秒没加载完成就停止加载并自动刷新 driver=webdriver.Chome() driver.set_page_load_timeout(10) while True: try: ...

  2. node.js应用生成windows service的plugin——winser

    from:http://xiaomijsj.blog.163.com/blog/static/89685520135854036206/ 针对项目中windows server machine 不断重 ...

  3. ionic项目注意点

    1.controller 名字一定要大写 config如过传递controller,则要使用controllerAs ,开头使用小写 2.在scss中新添加scss文件,要重启

  4. ASP.NET 4.0 ListView等容器控件中获取ClientID值与HTML中自动生成ID字符串不一样问题。

    ASP.NET 4.0 中 ClientIDMode的属性 可以设置获取不同ID格式的值. 项目中遇到的问题: 1.ListView1 ItemDataBound事件中,获取ClientID结果与自动 ...

  5. shell set 命令

    用set命令可以设置各种shell选项或者列出shell变量.单个选项设置常用的特性.在某些选项之后-o参数将特殊特性打开.在某些选项之后使用+o参数将关闭某些特性,不带任何参数的set命令将显示sh ...

  6. 主攻ASP.NET MVC4.0之重生:Jquery Mobile 面板

    左滑动面板效果: 右滑动面板效果: @{ ViewBag.Title = "JQuery Mobile Web Page"; } <!DOCTYPE html> < ...

  7. Maximum Subsequence Sum【最大连续子序列+树状数组解决】

    Problem Description 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i < ...

  8. mysqldump 的常用操作

    以下是 mysqldump 的一些使用参数 备份数据库#mysqldump 数据库名 >数据库备份名 #mysqldump -A -u用户名 -p密码 数据库名>数据库备份名 #mysql ...

  9. NLP学习常用的网页链接

    [2016.7.5] 这是以前学习的时候整理的,放到博客里面,以后再有的话会更新~ 1.一个国外的学者维护的博客,介绍NLP [链接](http://nlpers.blogspot.jp/) 2.北京 ...

  10. spring boot 打包

    打成jar直接运行比较简单,这里特别说明的是打成war包,部署在外部的tomcat方式: 1.修改启动代码 import org.springframework.boot.SpringApplicat ...