matthew as a q.

競技プログラミングメイン

C4996を回避する

環境

Windows 10, Visual Studio 2015

エラーメッセージ

C4996 'std::_Fill_n': 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' DPDPLibrary c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility 2810

回避方法

エラーメッセージにあるようにコンパイルオプション「_SCL_SECURE_NO_WARNINGS」を指定する。

Visual Studio 2015でのコンパイルオプションの設定は以下から行う。

該当プロジェクトを右クリック
→プロパティ
→構成プロパティ
C/C++
プリプロセッサ
プリプロセッサの定義の欄に、エラーメッセージの通りにコンパイルオプションを追加する。