How to Bypass a Standard C++ Function While Maintaining Its Functionality

前端 未结 7 946
迷失自我
迷失自我 2021-01-24 03:03

I am looking for a way to be able to redefine a set of POSIX functions but then end the redefinition with a call to the original function. The idea is that I am trying to create

7条回答
  •  野性不改
    2021-01-24 03:20

    In your MY_String.h:

    ... blah blah
    using mynamespace::strcpy;
    #endif // header guard or maybe not there if using pragma
    

    then all strcpys that are not prefixed with std:: will use yours. If you REALLY want to ban them, grep and take a shotgun with you when you find the person who used it.

提交回复
热议问题