each vector of vectors is a vector of int vectors, there are five* of them.
if I only use 4 it's fine.
if I use 5? bad things happen.
5 should yield 5(4(32^2)) bytes of data usage + whatever header data vectors have, or 20.48kb.
This, somehow, fails.
Code: Select all
std::vector< std::vector< int > > convertMeta(std::vector< std::vector< int > > input)
{
std::vector< std::vector< int > > output;
output.resize(input.size());
for(int x = 0; x < input.size(); x++)
{
output[0].resize(input[0].size());
for(int y = 0; y < input[0].size(); y++)
{
std::cout << "x: " << x << " y: " << y << " size: "
<< output.size() << " " << output[0].size() << std::endl;
//SNIP, this is just a switch that makes output.at(x).at(y) either 1 or 0.
//since neither X nor Y ever go past 31 this SHOULD not be a problem, besides the out of range happens for x:1, not x:32.
}
}
return output;
}
the debug printing indicates that the range error happens at X: 1 Y: 0 (right after X:0 Y: 31), but this is nonsense.
because it also blatantly shows that X has 32 available slots and that Y has 32 available slots.
output.size() returns 32.
output[0].size() also returns 32, is there some limit I am unaware of? If so, how would one bypass or work around said limit.
I didn't find any relevant data on it.
*plus how many are created when passing them as arguments, also assuming that the functions of type std::vector< std::vector< int > > aren't destructed when their scope ends, which they are/should be.