瀏覽代碼

Make one-argument constructor explicit to avoid unintended conversions.

Sascha Zelzer 13 年之前
父節點
當前提交
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();                                   \