__PRETTY_FUNCTION __,__ FUNCTION __,__ func__

__PRETTY_FUNCTION __,__ FUNCTION __,__ func__之间有什么区别?

什么之间的区别__PRETTY_FUNCTION____FUNCTION____func__,和他们在哪里记录?我如何决定使用哪一个?



BIG阳
浏览 1736回答 3
3回答

阿波罗的战车

尽管没有完全回答原始问题,但这可能是大多数人在谷歌搜索想要看到的。对于GCC:petanb@debian:~$ cat test.cpp&nbsp;#include <iostream>int main(int argc, char **argv){&nbsp; &nbsp; std::cout << __func__ << std::endl&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; << __FUNCTION__ << std::endl&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; << __PRETTY_FUNCTION__ << std::endl;}petanb@debian:~$ g++ test.cpp&nbsp;petanb@debian:~$&nbsp;petanb@debian:~$ ./a.out&nbsp;mainmainint main(int, char**)
打开App,查看更多内容
随时随地看视频慕课网APP