CF卡如何删除分区# PhotoGear - 摄影器材
g*j
1 楼
当constructor里面的某个member在initialization的时候fail了,到底会有memory
leak么?其他的已经完成的member到底由谁来释放?是系统自己自动释放还是需要在
catch exception之后用户写代码来自己释放?
我曾经看过说“C++里面没有partially constructed object, 只有full constructed
object”,难道不是说没有memory leak么?
为什么在Effective C++里面有这样一句话“if an exception is thrown during
construction of an object, any parts of the object that have already been
fully constructed are automatically destroyed”,这是不是说,只要throw
exception就够了,不需要在catch之后在代码里面释放? 如果这样,是不是说哪怕
fail也没有memory leak了?
总之,这个地方很confuse,谁来解释一下?
leak么?其他的已经完成的member到底由谁来释放?是系统自己自动释放还是需要在
catch exception之后用户写代码来自己释放?
我曾经看过说“C++里面没有partially constructed object, 只有full constructed
object”,难道不是说没有memory leak么?
为什么在Effective C++里面有这样一句话“if an exception is thrown during
construction of an object, any parts of the object that have already been
fully constructed are automatically destroyed”,这是不是说,只要throw
exception就够了,不需要在catch之后在代码里面释放? 如果这样,是不是说哪怕
fail也没有memory leak了?
总之,这个地方很confuse,谁来解释一下?