diff --git a/include/cantera/base/AnyMap.h b/include/cantera/base/AnyMap.h index 6bf1da64d..a3b07cb82 100644 --- a/include/cantera/base/AnyMap.h +++ b/include/cantera/base/AnyMap.h @@ -240,6 +240,8 @@ public: bool hasKey(const std::string& key) const; + void erase(const std::string& key); + //! Return a string listing the keys in this AnyMap, e.g. for use in error //! messages std::string keys_str() const; diff --git a/src/base/AnyMap.cpp b/src/base/AnyMap.cpp index 3c6a9b538..94523b05b 100644 --- a/src/base/AnyMap.cpp +++ b/src/base/AnyMap.cpp @@ -590,6 +590,11 @@ bool AnyMap::hasKey(const std::string& key) const return (m_data.find(key) != m_data.end()); } +void AnyMap::erase(const std::string& key) +{ + m_data.erase(key); +} + std::string AnyMap::keys_str() const { fmt::memory_buffer b;