Make RPCS3 compile in C++2a mode

This commit is contained in:
Nekotekina 2020-02-04 21:37:00 +03:00
parent e9e8f0c5b7
commit 1a78e0e80c
13 changed files with 141 additions and 109 deletions

View file

@ -8,8 +8,8 @@
namespace fmt
{
template <typename... Args>
static std::string format(const char*, const Args&...);
template <typename CharT, std::size_t N, typename... Args>
static std::string format(const CharT(&)[N], const Args&...);
}
template <typename T, typename>
@ -274,19 +274,19 @@ namespace fmt
void raw_append(std::string& out, const char*, const fmt_type_info*, const u64*) noexcept;
// Formatting function
template <typename... Args>
SAFE_BUFFERS FORCE_INLINE void append(std::string& out, const char* fmt, const Args&... args)
template <typename CharT, std::size_t N, typename... Args>
SAFE_BUFFERS FORCE_INLINE void append(std::string& out, const CharT(&fmt)[N], const Args&... args)
{
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};
raw_append(out, fmt, type_list, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
raw_append(out, reinterpret_cast<const char*>(fmt), type_list, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
// Formatting function
template <typename... Args>
SAFE_BUFFERS FORCE_INLINE std::string format(const char* fmt, const Args&... args)
template <typename CharT, std::size_t N, typename... Args>
SAFE_BUFFERS FORCE_INLINE std::string format(const CharT(&fmt)[N], const Args&... args)
{
std::string result;
append<Args...>(result, fmt, args...);
append(result, fmt, args...);
return result;
}