How to add code at the entry of every function?

前端 未结 6 876
悲哀的现实
悲哀的现实 2020-12-05 15:03

I want to add some code before every function call to do some checking. The only way I know is:

#define SOME_CODE printf(\"doing something...\");

class test         


        
6条回答
  •  无人及你
    2020-12-05 15:31

    As someone said in a comment, it is a typical use case of aspect / feature programming. You can try this to use aspect / feature programming with c++.

    my2c

提交回复
热议问题