What operators do I have to overload to see all operations when passing an object to a function?

前端 未结 1 1424
我寻月下人不归
我寻月下人不归 2020-12-07 06:25

I would like to write a piece of code that shows all copy/assignment/delete etc. operations that are done on the object when passing it to a function.

I wrote this:

1条回答
  •  有刺的猬
    2020-12-07 06:54

    In C++11, you should add rvalue reference:

    A(A&&);
    void operator=(A&& a );
    

    0 讨论(0)
提交回复
热议问题