From b12426ffeef41bf107b0388c56031d0d1ce4bcb8 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 6 Aug 2021 15:49:12 +0200 Subject: [PATCH] fixed compiling of numberparsing again --- src/numberparsing.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/numberparsing.h b/src/numberparsing.h index c25f51a..f18e582 100644 --- a/src/numberparsing.h +++ b/src/numberparsing.h @@ -11,67 +11,67 @@ #include namespace cpputils { -template constexpr tl::expected fromString(std::string_view str) = delete; +template tl::expected fromString(std::string_view str) = delete; -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - int8_t val{}; + int8_t val; if (std::sscanf(str.data(), "%" SCNi8, &val) != 1) return tl::make_unexpected(fmt::format("invalid int8_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - uint8_t val{}; + uint8_t val; if (std::sscanf(str.data(), "%" SCNu8, &val) != 1) return tl::make_unexpected(fmt::format("invalid uint8_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - int16_t val{}; + int16_t val; if (std::sscanf(str.data(), "%" SCNi16, &val) != 1) return tl::make_unexpected(fmt::format("invalid int16_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - uint16_t val{}; + uint16_t val; if (std::sscanf(str.data(), "%" SCNu16, &val) != 1) return tl::make_unexpected(fmt::format("invalid uint16_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - int32_t val{}; + int32_t val; if (std::sscanf(str.data(), "%" SCNi32, &val) != 1) return tl::make_unexpected(fmt::format("invalid int32_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - uint32_t val{}; + uint32_t val; if (std::sscanf(str.data(), "%" SCNu32, &val) != 1) return tl::make_unexpected(fmt::format("invalid uint32_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - int64_t val{}; + int64_t val; if (std::sscanf(str.data(), "%" SCNi64, &val) != 1) return tl::make_unexpected(fmt::format("invalid int64_t {}", str)); return val; } -template<> constexpr inline tl::expected fromString(std::string_view str) +template<> inline tl::expected fromString(std::string_view str) { - uint64_t val{}; + uint64_t val; if (std::sscanf(str.data(), "%" SCNu64, &val) != 1) return tl::make_unexpected(fmt::format("invalid uint64_t {}", str)); return val;