【error C4996: 'std::_Equal1': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct.
To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'】
【原因】:对C++标准库任何可能的不安全的调用都会导致C4996的错误。
【解决】:上策是改实参类型等来规范调用,下策是屏蔽警告。方法如下:
-D即difine a macro定义宏。在属性页、C/C++、预处理器、预处理器定义添加_SCL_SECURE_NO_WARNINGS即可,如图
PS:按理说在.cpp文件顶部添加#define _SCL_SECURE_NO_WARNINGS也可,但会有如下警告:
warning C4603: '_SCL_SECURE_NO_WARNINGS' : macro is not defined or definition is different after precompiled header use
故还是优先使用第一种方法吧。
参考:
点击打开链接 msdn:_SCL_SECURE_NO_WARNINGS