From 19cdd7c7128b8211386d5ecf09f48e206c4a446c Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Tue, 30 Apr 2024 11:57:42 +0200 Subject: [PATCH] Fixed assert and inline issue --- include/aidge/utils/DynamicAttributes.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/aidge/utils/DynamicAttributes.hpp b/include/aidge/utils/DynamicAttributes.hpp index 44c3b1f5e..fc3f3814f 100644 --- a/include/aidge/utils/DynamicAttributes.hpp +++ b/include/aidge/utils/DynamicAttributes.hpp @@ -86,7 +86,7 @@ public: template<class T> void addAttr(const std::string& name, const T& value) { const auto& res = mAttrs.emplace(std::make_pair(name, future_std::any(value))); - assert(res.second && "attribute already exists"); + AIDGE_ASSERT(res.second, "attribute already exists"); #ifdef PYBIND // We cannot handle Python object if the Python interpreter is not running @@ -129,10 +129,10 @@ public: void addAttrPy(const std::string& name, py::object&& value) { auto it = mAttrs.find(name); - assert(it == mAttrs.end() && "attribute already exists"); + AIDGE_ASSERT(it == mAttrs.end(), "attribute already exists"); const auto& res = mAttrsPy.emplace(std::make_pair(name, value)); - assert(res.second && "attribute already exists"); + AIDGE_ASSERT(res.second, "attribute already exists"); } void setAttrPy(const std::string& name, py::object&& value) override final @@ -199,6 +199,8 @@ public: }; #endif + virtual ~DynamicAttributes() {} + private: #ifdef PYBIND // Stores C++ attributes (copy) and Python-only attributes -- GitLab