C++, get the name of the function

后端 未结 5 885
长发绾君心
长发绾君心 2020-12-31 03:41

In C++, is there a way to get the function signature/name from it\'s pointer like this?

void test(float data) {}
cout << typeid(&test).name();
         


        
5条回答
  •  不思量自难忘°
    2020-12-31 04:36

    I'm not 100% sure, but this seems to me like reflection (Java), and C++ does not support things like this. It may be that I just don't know,but i havent seen this for C++ yet.

提交回复
热议问题