From: abn Date: Thu, 24 Sep 2020 18:53:07 +0000 (+0200) Subject: AutoPyPtr in an anonymous namespace to avoid suboject-linkage warning. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4f95e6ee831e3ea89c6c7b94315ed64f25bc0e2;p=tools%2Fmedcoupling.git AutoPyPtr in an anonymous namespace to avoid suboject-linkage warning. --- diff --git a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i index 2b49912aa..8095185b8 100644 --- a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i @@ -37,13 +37,15 @@ auto PyDeleter = [](PyObject *ob) { Py_DECREF(ob) ; }; -class AutoPyPtr : std::unique_ptr -{ - public: - AutoPyPtr(PyObject *ob):std::unique_ptr(ob,PyDeleter) { } - PyObject *retn() { return this->release(); } - operator PyObject *() const { return this->get(); } -}; +namespace { // Only in this TU, so in an anonymous namespace + class AutoPyPtr : std::unique_ptr + { + public: + AutoPyPtr(PyObject *ob):std::unique_ptr(ob,PyDeleter) { } + PyObject *retn() { return this->release(); } + operator PyObject *() const { return this->get(); } + }; +} AutoPyPtr convertMapStringInt(const std::map& cpp) {