Stringizing with __FUNCTION__ not working

一个人想着一个人 提交于 2021-01-29 20:09:50

问题


Simlar question with LINE

But when I replaced __LINE__ with __FUNCTION__. Macro concat string literal "__FUNCTION__" and not actual function name.


回答1:


__FUNCTION__ is not a macro, it's an implicitly declared static array. The same is true for __func__, __PRETTY_FUNCTION__, etc.

Thus # can't work on it. If you want to concatenate something to it, you'll have to do that at runtime.



来源:https://stackoverflow.com/questions/65798613/stringizing-with-function-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!