Prevent certain std functions from being called

You shouldn't try override o change functions in a standard library since in the first case you will have ODR violation and in the second case some of the thirdparties may used in your project may be affected.

I would suggest you to create a custom check for clang-tidy and add a CI job to run it on your codebase. This will take some time but I believe this is the best option.


There's no way you can mark any of the standard functions as unwanted in your code base.

You can do regular code reviews, or use a configurable static analysis tool to check committed code for usage of the unwanted functions though.
The latter only makes sense with an established CI process for your software.

Tags:

C++