// checked_iterators_3.cpp
// compile with: /EHsc /W1
#define _SECURE_SCL 1
#include <algorithm>
#include <iostream>
using namespace std;
using namespace stdext;
int main() {
int a [] = {1,2,3};
int b [10];
copy(a, a + 3, b); // C4996 unchecked iterator
copy(a, a + 3, checked_array_iterator<int*>(b, _countof(b))); // OK
}