以下信息摘自与标准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. requirejs源码分析: 路径

    1. 没有设置baseUrl(一般我们都会设置baseurl)        在没有设置baseUrl时, 默认  baseurl: "./"        当指定data-mai ...

  2. LeetCode:路径总和【112】

    LeetCode:路径总和[112] 题目描述 给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和. 说明: 叶子节点是指没有子节点的节点. 示例 ...

  3. ORA-28002 the password will expire

    ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

  4. sublime text3自动同步左边栏颜色背景为编辑栏颜色

    下面的步骤需要安装Package Control插件,如果你已经安装,可跳过本步骤,直接看第二步. 第一步:安装Package Control插件: 按Ctrl+`调出console(注:安装有QQ输 ...

  5. 主攻ASP.NET.4.5.1 MVC5.0之重生:空地搭建一个包含 Ninject框架 项目

    1.创建一个空白解决方案 2.添加一个类库 名称为XXX.Domain 3.添加一个ASP.MVC 名称为XXX.WebUI 4.选着空模版,勾选MVC核心引用 5.添加单元测试项目XXX.UntiT ...

  6. Go 文件操作

    一.读取文件 普通版 ioutil版 bufio版 二.文件写入 普通版 ioutil版 bufio版 三.文件复制 ioCopy 1.普通版读取文件 package main import ( &q ...

  7. 如何判断Linux服务器是否被入侵?

    被入侵服务器的症状 当服务器被没有经验攻击者或者自动攻击程序入侵了的话,他们往往会消耗 100% 的资源.他们可能消耗 CPU 资源来进行数字货币的采矿或者发送垃圾邮件,也可能消耗带宽来发动 DoS ...

  8. Spring Cloud Stream消息总线

    Springcloud 里面对于MQ的整合一个是前一篇的消息总线一个是本文介绍的消息驱动 大体要学习这么几个知识点: 课题:SpringCloud消息驱动Stream1.什么是SpringCloud消 ...

  9. 【bzoj2118&洛谷P2371】墨墨的等式(最短路神仙题)

    题目传送门:bzoj2118 洛谷P2371 这道题看了题解后才会的..果然是国家集训队的神仙题,思维独特. 首先若方程$ \sum_{i=1}^{n}a_ix_i=k $有非负整数解,那么显然对于每 ...

  10. 玲珑杯 第4次 String cut(暴力字符串)

    题意:给你长度为n(<=100000)的字符串,问你任意删除一个字符后得到循环节最多的数量是多少 题解:最简单的想法就是枚举删除的字符,再kmp求循环节,但是时间复杂度为O(n*n)会超时 因此 ...