Skip to content

Commit f60bdac

Browse files
committed
No virtual methods in Container class
Either this way, or make all of them virtual
1 parent a98eacd commit f60bdac

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

include/openPMD/backend/BaseRecord.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ class BaseRecord
114114

115115
virtual ~BaseRecord() = default;
116116

117-
mapped_type &operator[](key_type const &key) override;
118-
mapped_type &operator[](key_type &&key) override;
117+
mapped_type &operator[](key_type const &key);
118+
mapped_type &operator[](key_type &&key);
119119
mapped_type &at(key_type const &key);
120120
mapped_type const &at(key_type const &key) const;
121-
size_type erase(key_type const &key) override;
122-
iterator erase(iterator res) override;
121+
size_type erase(key_type const &key);
122+
iterator erase(iterator res);
123123
//! @todo add also, as soon as added in Container:
124124
// iterator erase(const_iterator first, const_iterator last) override;
125125

include/openPMD/backend/Container.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class Container : virtual public Attributable
283283
* @throws std::out_of_range error if in READ_ONLY mode and key does not
284284
* exist, otherwise key will be created
285285
*/
286-
virtual mapped_type &operator[](key_type const &key)
286+
mapped_type &operator[](key_type const &key)
287287
{
288288
auto it = container().find(key);
289289
if (it != container().end())
@@ -318,7 +318,7 @@ class Container : virtual public Attributable
318318
* @throws std::out_of_range error if in READ_ONLY mode and key does not
319319
* exist, otherwise key will be created
320320
*/
321-
virtual mapped_type &operator[](key_type &&key)
321+
mapped_type &operator[](key_type &&key)
322322
{
323323
auto it = container().find(key);
324324
if (it != container().end())
@@ -382,7 +382,7 @@ class Container : virtual public Attributable
382382
* @param key Key of the element to remove.
383383
* @return Number of elements removed (either 0 or 1).
384384
*/
385-
virtual size_type erase(key_type const &key)
385+
size_type erase(key_type const &key)
386386
{
387387
if (Access::READ_ONLY == IOHandler()->m_frontendAccess)
388388
throw std::runtime_error(
@@ -400,7 +400,7 @@ class Container : virtual public Attributable
400400
}
401401

402402
//! @todo why does const_iterator not work compile with pybind11?
403-
virtual iterator erase(iterator res)
403+
iterator erase(iterator res)
404404
{
405405
if (Access::READ_ONLY == IOHandler()->m_frontendAccess)
406406
throw std::runtime_error(

0 commit comments

Comments
 (0)