Просмотр исходного кода

Make one-argument constructor explicit to avoid unintended conversions.

Sascha Zelzer лет назад: 13
Родитель
Сommit
9075850461
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      Libs/Core/ctkException.h

+ 2 - 2
Libs/Core/ctkException.h

@@ -48,7 +48,7 @@ public:
    * @brief Create a new ctkException.
    * @param msg The exception message.
    */
-  ctkException(const QString& msg);
+  explicit ctkException(const QString& msg);
 
   /**
    * @brief Create a new ctkException containing another exception as the cause.
@@ -139,7 +139,7 @@ CTK_CORE_EXPORT QDebug operator<<(QDebug dbg, const ctkException& exc);
   class API CLS : public BASE                         \
   {                                                   \
   public:                                             \
-    CLS(const QString& msg);                          \
+    explicit CLS(const QString& msg);                 \
     CLS(const QString& msg, const ctkException& exc); \
     CLS(const CLS& exc);                              \
     ~CLS() throw();                                   \