NULL check before deleting an object with an overloaded delete

前端 未结 11 1796
野性不改
野性不改 2020-12-18 18:24

This came up as one of the code review comments.

Is it a good idea to check for NULL before calling delete for any object?

I do understand delete operator c

11条回答
  •  独厮守ぢ
    2020-12-18 18:31

    Is it not necesary to check. If anyone overload the pethod, is his responsibility to to whatever with NULL.

提交回复
热议问题