mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Core/Misc): Remove Clang 7 workaround (#10521)
This commit is contained in:
@@ -90,71 +90,6 @@ namespace Acore::Impl::StringConvertImpl
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef ACORE_NEED_CHARCONV_WORKAROUND
|
||||
/*
|
||||
If this is defined, std::from_chars will cause linkage errors for 64-bit types.
|
||||
(This is a bug in clang-7.)
|
||||
|
||||
If the clang requirement is bumped to >= clang-8, remove this ifdef block and its
|
||||
associated check in cmake/compiler/clang/settings.cmake
|
||||
*/
|
||||
template <>
|
||||
struct For<uint64, void>
|
||||
{
|
||||
static Optional<uint64> FromString(std::string_view str, int base = 10)
|
||||
{
|
||||
if (str.empty())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
try
|
||||
{
|
||||
size_t n;
|
||||
uint64 val = std::stoull(std::string(str), &n, base);
|
||||
if (n != str.length())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
catch (...) { return std::nullopt; }
|
||||
}
|
||||
|
||||
static std::string ToString(uint64 val)
|
||||
{
|
||||
return std::to_string(val);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct For<int64, void>
|
||||
{
|
||||
static Optional<int64> FromString(std::string_view str, int base = 10)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (str.empty())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
size_t n;
|
||||
int64 val = std::stoll(std::string(str), &n, base);
|
||||
if (n != str.length())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
catch (...) { return std::nullopt; }
|
||||
}
|
||||
|
||||
static std::string ToString(int64 val)
|
||||
{
|
||||
return std::to_string(val);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct For<bool, void>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user