arrays in classes

Started by
10 comments, last by SiCrane 14 years, 5 months ago
I am rendering the image to a file thank you.

You seem to misunderstand, I have nothing against boost, as I have already stated, I just don't want to use it. I'm sure you've encountered some situation in your life where you would rather go left than right even if the roads meet up in the same place. I just don't want to use boost.
Advertisement
Quote:Original post by Hodgman
In theory, you'll have undefined behaviour ;)
In practice, that behaviour will likely be a leak (but could be anything).

Actually, what happens in practice is generally one of two things:
1) if the type contained by the array doesn't have a destructor, the memory will generally be deallocated "correctly".
2) if the type contained by the array does have destructor, only one of the contained objects will be destroyed and then an invalid address will passed to the underlying allocator. This generally results in heap corruption and could well cause the application to crash then and there. More insidiously the application could continue for a while and then crash in unrelated code later.

This topic is closed to new replies.

Advertisement