X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMCAuto.hxx;h=06f728620b0bc836c2dbe4f7631c21d5e80f5ff1;hb=e7835cba1eb17f50ef4e130c2cb8d0f54bc25083;hp=6614cbfdfaa383eba763f4710628c5a8ab019eea;hpb=5333bed206ae35b171662cf2a5651243c840c036;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MCAuto.hxx b/src/MEDCoupling/MCAuto.hxx index 6614cbfdf..06f728620 100644 --- a/src/MEDCoupling/MCAuto.hxx +++ b/src/MEDCoupling/MCAuto.hxx @@ -85,6 +85,7 @@ namespace MEDCoupling { public: MCConstAuto(const MCConstAuto& other):_ptr(0) { referPtr(other._ptr); } + MCConstAuto(const typename MEDCoupling::MCAuto & other):_ptr(0) { referPtr( (const T*) other); } MCConstAuto(const T *ptr=0):_ptr(ptr) { } ~MCConstAuto() { destroyPtr(); } bool isNull() const { return _ptr==0; } @@ -101,7 +102,7 @@ namespace MEDCoupling const T& operator*() const { return *_ptr; } operator const T *() const { return _ptr; } private: - void referPtr(T *ptr) { _ptr=ptr; if(_ptr) _ptr->incrRef(); } + void referPtr(const T *ptr) { _ptr=ptr; if(_ptr) _ptr->incrRef(); } void destroyPtr() { if(_ptr) _ptr->decrRef(); } private: const T *_ptr;