Vector.push_back()
23:29:43 Monday, July 13, 2009 in
Technology
Tend to be most productive (lines of code produced) in the evenings, but it’s not always the best for writing code that compiles in one go.
Took me a while to realise, despite knowing it and doing it right probably a dozen times elsewhere in the program,
cornerPerVector.at(i).push_back(*tempPoint);
will throw an exception.
But
tempVec.push_back(*tempPoint);
cornerPerVector.push_back(tempVec);
won’t.
Time to find bug:
~10 mins
Update: Sean noticed I’d the same code for the exception and fix. I’m an idiot.