From e4f95e6ee831e3ea89c6c7b94315ed64f25bc0e2 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 24 Sep 2020 20:53:07 +0200 Subject: [PATCH] AutoPyPtr in an anonymous namespace to avoid suboject-linkage warning. --- src/MEDCoupling_Swig/MEDCouplingTypemaps.i | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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) { -- 2.39.2