Split error macro into two versions (format vs non-formating) to allow format checking at compile-time

This commit is contained in:
SirLynix
2023-11-02 15:18:03 +01:00
parent 8fb53f467b
commit 4b8a475bbd
133 changed files with 570 additions and 557 deletions

View File

@@ -15,15 +15,13 @@ namespace Nz
return file;
}
template<typename... Args>
void Error::Trigger(ErrorType type, std::string_view error, Args&&... args)
inline void Error::Trigger(ErrorType type, std::string error)
{
return TriggerInternal(type, Format(error, std::forward<Args>(args)...), 0, {}, {});
return TriggerInternal(type, std::move(error), 0, {}, {});
}
template<typename... Args>
void Error::Trigger(ErrorType type, unsigned int line, std::string_view file, std::string_view function, std::string_view error, Args&&... args)
inline void Error::Trigger(ErrorType type, unsigned int line, std::string_view file, std::string_view function, std::string error)
{
return TriggerInternal(type, Format(error, std::forward<Args>(args)...), line, GetCurrentFileRelativeToEngine(file), function);
return TriggerInternal(type, std::move(error), line, GetCurrentFileRelativeToEngine(file), function);
}
}