use - D_SCL_SECURE_NO_WARNINGS

时间:2021-06-01 16:59:26

VC2015发生以下报错:

1>c:\program files\microsoft visual studio 14.0\vc\include\xutility(2229) : error C4996 : 'std::_Copy_impl' : 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'

在开始头文件,增加以下语句即可:

 #define _SCL_SECURE_NO_WARNINGS