_SECURE_SCL changes the size of iterators in release builds from 4 bytes (off) to 8 bytes on because it stores a reference to the containing object. In fact this behaviour violates standard 23.1.10 (no swap invalidates any iterators referring to the elements of the containers being swapped).The change in size can cause serious problems when linking against third party libraries which use the STL and can lead to situations where it is impossible to use STL (if you use libraryA built with _SECURE_SCL=0 and libraryB with _SECURE_SCL=1). It is thus totally non standard compliant. If there is reason to change the size of stl objects they should be renamed and put in a separate namespace e.g. stdexp::checkedvector.There is no way for me as a user to check what setting was used by a third party library vendor and my reading of the standard suggest _SECURE_SCL=0 is required to be standard compliant due to the problem of swap and _SECURE_SCL=1.VS2005 has a superb IDE, but the most important aspect of any C++ compiler is how closely is complies with the ISO standard.As the MS ABI requires a complete rebuild of all DLLs for even a minor version change e.g RTM to SP1 due to the annoying embedded manifests this should be easy to fix without worries about backward compatibility.Suggested fix:Get rid of _SECURE_SCL and define extra objects in stdext providing the checked iterator behaviour.
Version
Please wait...