Given the following code:
#include <memory>
#include <locale>
int main() {
auto source = std::make_unique<int[]>(16);
auto dest = std::make_unique<int[]>(16);
auto dp = stdext::checked_array_iterator<int*>(dest.get(), 16);
std::copy_n(source.get(), 16, dp);
return 0;
}
It compiles cleanly on Visual Studio 2013 by running cl.exe /EHsc <file>.cpp
. However, on Visual Studio 2017 the following errors (among others) are thrown by cl.exe
:
vc12.cpp(7): error C2653: 'stdext': is not a class or namespace name
vc12.cpp(7): error C2065: 'checked_array_iterator': undeclared identifier
Why does this code no longer compile?