Simplify format_error

This commit is contained in:
Victor Zverovich 2022-09-16 14:25:14 -07:00
parent 3178bb9a26
commit ac85afaab6

View File

@ -961,13 +961,11 @@ FMT_API bool write_console(std::FILE* f, string_view text);
FMT_API void print(std::FILE*, string_view); FMT_API void print(std::FILE*, string_view);
} // namespace detail } // namespace detail
/** A formatting error such as invalid format string. */ /** An error reported from a formatting function. */
FMT_CLASS_API FMT_CLASS_API
class FMT_API format_error : public std::runtime_error { class FMT_API format_error : public std::runtime_error {
public: public:
explicit format_error(const char* message) : std::runtime_error(message) {} using std::runtime_error::runtime_error;
explicit format_error(const std::string& message)
: std::runtime_error(message) {}
format_error(const format_error&) = default; format_error(const format_error&) = default;
format_error& operator=(const format_error&) = default; format_error& operator=(const format_error&) = default;
format_error(format_error&&) = default; format_error(format_error&&) = default;