فهرست منبع

exception: Make constructors explicit

Ensures that exception construction is always explicit.
Lioncash 5 سال پیش
والد
کامیت
c27ddb44de
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      src/shader_recompiler/exception.h

+ 4 - 4
src/shader_recompiler/exception.h

@@ -36,21 +36,21 @@ private:
 class LogicError : public Exception {
 class LogicError : public Exception {
 public:
 public:
     template <typename... Args>
     template <typename... Args>
-    LogicError(const char* message, Args&&... args)
+    explicit LogicError(const char* message, Args&&... args)
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
 };
 };
 
 
 class RuntimeError : public Exception {
 class RuntimeError : public Exception {
 public:
 public:
     template <typename... Args>
     template <typename... Args>
-    RuntimeError(const char* message, Args&&... args)
+    explicit RuntimeError(const char* message, Args&&... args)
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
 };
 };
 
 
 class NotImplementedException : public Exception {
 class NotImplementedException : public Exception {
 public:
 public:
     template <typename... Args>
     template <typename... Args>
-    NotImplementedException(const char* message, Args&&... args)
+    explicit NotImplementedException(const char* message, Args&&... args)
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {
         Append(" is not implemented");
         Append(" is not implemented");
     }
     }
@@ -59,7 +59,7 @@ public:
 class InvalidArgument : public Exception {
 class InvalidArgument : public Exception {
 public:
 public:
     template <typename... Args>
     template <typename... Args>
-    InvalidArgument(const char* message, Args&&... args)
+    explicit InvalidArgument(const char* message, Args&&... args)
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
         : Exception{fmt::format(fmt::runtime(message), std::forward<Args>(args)...)} {}
 };
 };