Recently, when porting some STL code to VS2008 I wanted to disable warnings generated by std::copy
by defining the new _SCL_SECURE_NO_WARNINGS
flag. You can do this in two ways:
- Using the /D compiler switch, which can be specified in the project properties. You need to ensure it is defined for both Release and Debug builds, which I often forget to do.
By defining it macro style before you include the relevant STL headers, or, for total coverage, in stdafx.h:
#define _SCL_SECURE_NO_WARNINGS
Both of these methods work fine but I wondered if there was any argument for favouring one over the other?