C ++ __COUNTER__定义 [英] C++ __COUNTER__ Definition

查看:317
本文介绍了C ++ __COUNTER__定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个版本的c ++编译器安装在我的电脑上。其中一个识别 __ COUNTER __ 宏,另一个不识别。在做了一些研究使程序编译之后,我还没有遇到 __ COUNTER __ 的宏定义。这是一些特殊的宏由编译器做,或者我可以复制 __ COUNTER __ 的定义到我的源代码,如果我可以复制它是我需要的代码。

I have two versions of a c++ compiler installed on my computer. One of them recognizes the __COUNTER__ macro and the other does not. After doing some research to make the program compile in both I have yet to come across the Macro definition for __COUNTER__. Is this some special Macro done by the compiler or can I copy the definition for __COUNTER__ into my source code, if I can copy it what is the code I need.

推荐答案

__ COUNTER __ 是几个常用编译器中内置的。无法手动定义。如果你遇到了不支持它的编译器,你最好的选择是通过支持它的预处理器运行你的代码,然后再将它送入编译器。

__COUNTER__ is a built-in in several common compilers. It is not possible to define manually. If you're stuck with a compiler that doesn't support it, your best option might be to run your code through a preprocessor that does support it before feeding it into the compiler.

这篇关于C ++ __COUNTER__定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆