getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Andriy Andreykiv
Subject: [Getfem-commits] (no subject)
Date: Mon, 30 Jul 2018 21:54:36 -0400 (EDT)

branch: comparing_stored_objects_by_key
commit 79fb7ae312a6ebf4e954d1bf54e5f3747f74ff14
Author: aa <address@hidden>
Date:   Tue Jul 31 00:20:02 2018 +0200

    overriding equal for method_key
---
 src/getfem/dal_naming_system.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/getfem/dal_naming_system.h b/src/getfem/dal_naming_system.h
index 71f1226..9c66eb5 100644
--- a/src/getfem/dal_naming_system.h
+++ b/src/getfem/dal_naming_system.h
@@ -89,9 +89,13 @@ namespace dal {
     struct method_key : virtual public static_stored_object_key {
       std::string name;
 
-      virtual bool compare(const static_stored_object_key &oo) const {
-       const method_key &o = dynamic_cast<const method_key &>(oo);
-       if (name < o.name) return true; else return false;
+      bool compare(const static_stored_object_key &oo) const override{
+            auto &o = dynamic_cast<const method_key &>(oo);
+            return name < o.name;
+      }
+      bool equal(const static_stored_object_key &oo) const override{
+            auto &o = dynamic_cast<const method_key &>(oo);
+            return name == o.name;
       }
       method_key(const std::string &name_) : name(name_) {}
     };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]