]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
AutoPyPtr in an anonymous namespace to avoid suboject-linkage warning.
authorabn <adrien.bruneton@cea.fr>
Thu, 24 Sep 2020 18:53:07 +0000 (20:53 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 24 Sep 2020 18:53:07 +0000 (20:53 +0200)
src/MEDCoupling_Swig/MEDCouplingTypemaps.i

index 2b49912aaa002c60c0f706146e2ab0709444de32..8095185b8f4929d3003bb845cdd48cdfe6bf95c4 100644 (file)
 
 auto PyDeleter = [](PyObject *ob) { Py_DECREF(ob) ; };
 
-class AutoPyPtr : std::unique_ptr<PyObject,decltype(PyDeleter)>
-{
-  public:
-  AutoPyPtr(PyObject *ob):std::unique_ptr<PyObject,decltype(PyDeleter)>(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<PyObject,decltype(PyDeleter)>
+  {
+    public:
+      AutoPyPtr(PyObject *ob):std::unique_ptr<PyObject,decltype(PyDeleter)>(ob,PyDeleter) { }
+      PyObject *retn() { return this->release(); }
+      operator PyObject *() const { return this->get(); }
+  };
+}
 
 AutoPyPtr convertMapStringInt(const std::map<std::string,mcIdType>& cpp)
 {