Core/Database: Enable perfect forwarding for database format calls.

(cherry picked from commit ca16dc8c1b8da86f55a790a5f8cc6913dd005fcc)
This commit is contained in:
Naios committed 2015-07-22 02:18:38 +02:00
1 parent e011ae63d5
commit 7f377a4f1b
4 files changed
+45 -27

No files matched your search

+13 -1
View File
@@ -19,7 +19,7 @@
#ifndef TRINITYCORE_STRING_FORMAT_H
#define TRINITYCORE_STRING_FORMAT_H
#include <format.h>
#include "format.h"
namespace Trinity
{
@@ -29,6 +29,18 @@ namespace Trinity
{
return fmt::sprintf(std::forward<Format>(fmt), std::forward<Args>(args)...);
}
/// Returns true if the given char pointer is null.
inline bool IsFormatEmptyOrNull(const char* fmt)
{
return fmt == nullptr;
}
/// Returns true if the given std::string is empty.
inline bool IsFormatEmptyOrNull(std::string const& fmt)
{
return fmt.empty();
}
}
#endif