Even simpler DeadlyErrorBase

pull/3375/head
Malcolm Tyrrell 2020-08-19 17:59:13 +01:00
parent 6f9c61e157
commit 9b5e758bdd
2 changed files with 3 additions and 10 deletions

View File

@ -48,11 +48,7 @@ Implementations of the exception classes.
#include <assimp/Exceptional.h> #include <assimp/Exceptional.h>
#include <assimp/TinyFormatter.h> #include <assimp/TinyFormatter.h>
DeadlyErrorBase::DeadlyErrorBase(const std::string& errorText)
: runtime_error(errorText)
{}
DeadlyErrorBase::DeadlyErrorBase(Assimp::Formatter::format f) DeadlyErrorBase::DeadlyErrorBase(Assimp::Formatter::format f)
: DeadlyErrorBase(std::string(f)) : runtime_error(std::string(f))
{ {
} }

View File

@ -58,13 +58,10 @@ using std::runtime_error;
class ASSIMP_API DeadlyErrorBase : public runtime_error { class ASSIMP_API DeadlyErrorBase : public runtime_error {
protected: protected:
/** Constructor with arguments */ DeadlyErrorBase(Assimp::Formatter::format f);
explicit DeadlyErrorBase(const std::string& errorText);
explicit DeadlyErrorBase(Assimp::Formatter::format f);
template<typename... T, typename U> template<typename... T, typename U>
explicit DeadlyErrorBase(Assimp::Formatter::format f, U&& u, T&&... args) DeadlyErrorBase(Assimp::Formatter::format f, U&& u, T&&... args)
: DeadlyErrorBase(std::move(f << std::forward<U>(u)), std::forward<T>(args)...) : DeadlyErrorBase(std::move(f << std::forward<U>(u)), std::forward<T>(args)...)
{ {
} }