Print address of virtual member function

后端 未结 5 1284
眼角桃花
眼角桃花 2020-12-01 13:57

I am trying to print the address of a virtual member function. If I know which class implements the function I can write:

print(\"address: %p\", &A::func         


        
5条回答
  •  忘掉有多难
    2020-12-01 14:14

    Doesn't make a lot a of sense to me. If you have a normal function:

    void f( int n ) {
    }
    

    then you can take its address:

    f
    

    but you cannot take the address of a function call, which is what you seem to want to do.

提交回复
热议问题