是否有类名宏? [英] Is there a class name macro?

查看:61
本文介绍了是否有类名宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




__PRETTY_FUNCTION__是一个给出函数名称等的宏。我是

想知道是否有一个宏来获取该类会员名称

功能。


谢谢,


解决方案

Peng Yu写道:





__PRETTY_FUNCTION__是一个给出函数名称的宏等等



是吗?


我是

想知道是否有一个宏来获取成员中的类名

函数。



不在标准C ++中。


-

Ian Collins。


9月15日晚上8:24,Ian Collins< ian- n ... @ hotmail.comwrote:


Peng Yu写道:




__PRETTY_FUNCTION__是一个给出函数名称等的宏。



是吗?


我是

想知道是否有一个宏来获取成员内的类名

函数。



不在标准C ++中。



我知道__PRETTY_FUNCTION__不在标准中。但标准

有类似的东西,我只记得它是什么。但我的

问题是关于班级名称的。


谢谢,




Peng Yu写道:


9月15日晚上8:24,Ian Collins< ian-n ... @ hotmail .comwrote:


> Peng Yu写道:




__PRETTY_FUNCTION__是一个给出函数名称等的宏。


是吗?


我是

想知道是否有一个宏来获取成员内的类名

函数。


不在标准C ++中。



我知道__PRETTY_FUNCTION__不在标准范围内。但标准

有类似的东西,我只记得它是什么。



标准有以下预定义的宏[16.8]:


__LINE__

__FILE __

__DATE__

__TIME__

__STDC__

__cplusplus__


其他一切都是具体实现。


但我的问题是关于班级名称。



您的问题已得到解答:不在标准C ++中。

最佳

Kai-Uwe Bux


Hi,

__PRETTY_FUNCTION__ is a macro that gives function name, etc. I''m
wondering if there is a macro to get the class name inside a member
function.

Thanks,
Peng

解决方案

Peng Yu wrote:

Hi,

__PRETTY_FUNCTION__ is a macro that gives function name, etc.

Is it?

I''m
wondering if there is a macro to get the class name inside a member
function.

Not in standard C++.

--
Ian Collins.


On Sep 15, 8:24 pm, Ian Collins <ian-n...@hotmail.comwrote:

Peng Yu wrote:

Hi,

__PRETTY_FUNCTION__ is a macro that gives function name, etc.


Is it?

I''m
wondering if there is a macro to get the class name inside a member
function.


Not in standard C++.

I know __PRETTY_FUNCTION__ is not in the standard. But the standard
has something similar to it, I just do remember what it is. But my
questions was on the class name.

Thanks,
Peng


Peng Yu wrote:

On Sep 15, 8:24 pm, Ian Collins <ian-n...@hotmail.comwrote:

>Peng Yu wrote:

Hi,

__PRETTY_FUNCTION__ is a macro that gives function name, etc.


Is it?

I''m
wondering if there is a macro to get the class name inside a member
function.


Not in standard C++.


I know __PRETTY_FUNCTION__ is not in the standard. But the standard
has something similar to it, I just do remember what it is.

The standard has the following predefined macros [16.8]:

__LINE__
__FILE__
__DATE__
__TIME__
__STDC__
__cplusplus__

Everything else is implementation specific.

But my questions was on the class name.

And your question has been answered: "not in standard C++".
Best

Kai-Uwe Bux


这篇关于是否有类名宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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