From be47e70966093bf7d83486a7225bb3929e02727b Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 26 Jul 2016 09:43:09 +0200 Subject: [PATCH] Useful nullify method --- src/MEDCoupling/MCAuto.hxx | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.39.2