diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2021-07-27 21:11:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 21:11:17 +0200 |
commit | 5da97c57cdc2419176aca61b3f873a865da1dee5 (patch) | |
tree | bc69bb0b43be003b38fb626caf61720da73bef74 | |
parent | Merge pull request #6745 from lioncash/copies (diff) | |
parent | exception: Make constructors explicit (diff) | |
download | yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar.gz yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar.bz2 yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar.lz yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar.xz yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.tar.zst yuzu-5da97c57cdc2419176aca61b3f873a865da1dee5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/exception.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/exception.h b/src/shader_recompiler/exception.h index 337e7f0c8..277be8541 100644 --- a/src/shader_recompiler/exception.h +++ b/src/shader_recompiler/exception.h @@ -4,7 +4,7 @@ #pragma once -#include <stdexcept> +#include <exception> #include <string> #include <string_view> #include <utility> @@ -17,7 +17,7 @@ class Exception : public std::exception { public: explicit Exception(std::string message) noexcept : err_message{std::move(message)} {} - const char* what() const noexcept override { + [[nodiscard]] const char* what() const noexcept override { return err_message.c_str(); } @@ -36,21 +36,21 @@ private: class LogicError : public Exception { public: 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)...)} {} }; class RuntimeError : public Exception { public: 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)...)} {} }; class NotImplementedException : public Exception { public: 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)...)} { Append(" is not implemented"); } @@ -59,7 +59,7 @@ public: class InvalidArgument : public Exception { public: 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)...)} {} }; |