jeudi 29 décembre 2016

Std::copy fails in debug build

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

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));

Aucun commentaire:

Enregistrer un commentaire