How to find the name of the current function at runtime?

后端 未结 7 769
走了就别回头了
走了就别回头了 2021-01-31 15:17

After years of using the big ugly MFC ASSERT macro, I have finally decided to ditch it and create the ultimate ASSERT macro.

I am fine with getting the file and line num

7条回答
  •  有刺的猬
    2021-01-31 15:51

    __FUNCTION__ or __FUNC__ or __PRETTY_FUNCTION__

    http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

提交回复
热议问题