Frankly, if I'm to take that quote seriously, you are actually saving space, not overhead. Overhead is basically a run-time performance cost you incur using ... almost anything. Arrays incur it when...
Type: Posts; User: whiteflags
Frankly, if I'm to take that quote seriously, you are actually saving space, not overhead. Overhead is basically a run-time performance cost you incur using ... almost anything. Arrays incur it when...
Basically what I said, but I wanted to make the point that by itself, a destructor isn't going to save you from memory leaks like I thought Kyo was saying.
Well if you want my opinion on it, pointers don't break C++, C++ broke pointers.
Yay.
But programmers are a battered wife to C++ and it's a lot easier to try to do things its way. C++'s own...
Actually the allocator's destructor would never be called, since the STL uses allocator objects, and I'm not privy to whether that's important or not. ~vector() will be called.
Memory leaks can be caused by incredibly innocent things, like throwing exceptions from constructors. Say new throws in the constructor: your object's destructor never gets called. Those member data...