From: Anthony Geay Date: Tue, 26 Jul 2016 07:43:09 +0000 (+0200) Subject: Useful nullify method X-Git-Tag: V8_1_0b1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=be47e70966093bf7d83486a7225bb3929e02727b;p=tools%2Fmedcoupling.git Useful nullify method --- diff --git a/src/MEDCoupling/MCAuto.hxx b/src/MEDCoupling/MCAuto.hxx index 810f4d379..6241b3c3f 100644 --- a/src/MEDCoupling/MCAuto.hxx +++ b/src/MEDCoupling/MCAuto.hxx @@ -35,6 +35,7 @@ namespace MEDCoupling ~MCAuto() { destroyPtr(); } bool isNull() const { return _ptr==0; } bool isNotNull() const { return !isNull(); } + void nullify() { destroyPtr(); _ptr=0; } bool operator==(const MCAuto& other) const { return _ptr==other._ptr; } bool operator==(const T *other) const { return _ptr==other; } MCAuto &operator=(const MCAuto& other) { if(_ptr!=other._ptr) { destroyPtr(); referPtr(other._ptr); } return *this; }