I have the following code which throws out of bounds exception in debug build but works correctly in release build 

```
typedef unsigned int uint;
std::array<uint, 4> expArray = {51,639,398,744};
unsigned dataArraySize = sizeof(expArray) / sizeof(uint) ;
std::vector<uint> expected ;
std::copy(&expArray[0], &expArray[dataArraySize], back_inserter(expected));

```