We have an algorithm library doing lots of std::min
/std::max
operations on numbers that could be NaN. Considering this post: Why does Release/Debug have a different result for std::min?, we realised it's clearly unsafe.
Is there a way to prevent developers from using std::min
/std::max
?
Our code is compiled both with VS2015 and g++. We have a common header file included by all our source files (through /FI
option for VS2015 and -include
for g++). Is there any piece of code/pragma that could be put here to make any cpp file using std::min
or std::max
fail to compile?
By the way, legacy code like STL headers using this function should not be impacted. Only the code we write should be impacted.
std
), you can mark the function as deprecated. – Jarod42 1 hour ago