Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
be more explicit
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 19 Jul 2017 15:57:55 +0000 (17:57 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 19 Jul 2017 15:57:55 +0000 (17:57 +0200)
include/xbt/Extendable.hpp
include/xbt/exception.hpp

index f158d50..5cf36a9 100644 (file)
@@ -24,7 +24,7 @@ class Extension {
   friend class Extendable<T>;
   constexpr Extension(std::size_t id) : id_(id) {}
 public:
-  constexpr Extension() : id_(INVALID_ID) {}
+  explicit constexpr Extension() : id_(INVALID_ID) {}
   std::size_t id() const { return id_; }
   bool valid() { return id_ != INVALID_ID; }
 };
index 6e80198..7c826cd 100644 (file)
@@ -72,16 +72,10 @@ public:
     procname_(xbt_procname()),
     pid_(xbt_getpid())
   {}
-  WithContextException(Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid())
+  explicit WithContextException(Backtrace bt) : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid())
   {}
-  WithContextException(ThrowPoint throwpoint, Backtrace bt) :
-    backtrace_(std::move(bt)),
-    procname_(xbt_procname()),
-    pid_(xbt_getpid()),
-    throwpoint_(throwpoint)
+  explicit WithContextException(ThrowPoint throwpoint, Backtrace bt)
+      : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid()), throwpoint_(throwpoint)
   {}
   virtual ~WithContextException();
   Backtrace const& backtrace() const
@@ -116,7 +110,7 @@ public:
   WithContext(E exception, WithContextException context) :
     E(std::move(exception)),
     WithContextException(std::move(context)) {}
-  ~WithContext() override {}
+  ~WithContext() override = default;
 };
 
 /** Throw a C++ exception with some context