05-23-2012, 03:57 AM
I've replaced the auto_ptr usage for char arrays in the branch. I won't be porting that to the trunk, 'cause I think the branch is now in a much better shape than the trunk
As for not using auto_ptr at all, I tend to disagree. It's much safer using it than not using anything at all, and it's safe enough in our context so that nothing else needs to be used.
The only reason we're using auto_ptr is its ability to delete data unless explicitly told not to. This coincides with our algorithms, producing data in buffers and throwing away those buffers if anything goes wrong. Since we're not using exceptions at all, exception safety is something we should be too concerned about - we know about them, alright, but we don't handle them anyway, so any exception will basically crash MCS, no point in deallocating memory before the crash
As for not using auto_ptr at all, I tend to disagree. It's much safer using it than not using anything at all, and it's safe enough in our context so that nothing else needs to be used.
The only reason we're using auto_ptr is its ability to delete data unless explicitly told not to. This coincides with our algorithms, producing data in buffers and throwing away those buffers if anything goes wrong. Since we're not using exceptions at all, exception safety is something we should be too concerned about - we know about them, alright, but we don't handle them anyway, so any exception will basically crash MCS, no point in deallocating memory before the crash