Browse Source

Fix rom_string<long> methods for platforms where sizeof(long) > sizeof(int)

master
Jessica James 3 years ago
parent
commit
6578fef47f
  1. 10
      src/include/Jupiter/Readable_String.h

10
src/include/Jupiter/Readable_String.h

@ -117,13 +117,23 @@ namespace Jupiter {
template<>
inline long from_string<long>(std::string_view in_string) {
if constexpr (sizeof(long) == sizeof(int)) {
return asInt(in_string);
}
else {
return static_cast<long>(asLongLong(in_string));
}
}
template<>
inline unsigned long from_string<unsigned long>(std::string_view in_string) {
if constexpr (sizeof(long) == sizeof(int)) {
return asUnsignedInt(in_string);
}
else {
return static_cast<unsigned long>(asUnsignedLongLong(in_string));
}
}
template<>
inline long long from_string<long long>(std::string_view in_string) {

Loading…
Cancel
Save