For some reason I'm having a brain cramp. I'm guessing this is really bad due to the functions within the vector class, but figured I might as well query "the mob".
Bad, okay, or just safer to swap out the STL vector with an int*?Code:#include <vector> struct foo { std::vector<int> fooVec; }; foo var1; memset(&var1, 0, sizeof(foo));
(Yes in my example zeroing the memory is pointless, but imagine it having like 15+ variables in addition to the vector that I wish to quickly initialize to Zero)



LinkBack URL
About LinkBacks




CornedBee