From 2e5f6852750ea3aec8bc67f4fce06244e46b1790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 20 Oct 2024 04:27:15 -0300 Subject: [PATCH] Should fix builds... --- include/eepp/core/string.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/eepp/core/string.hpp b/include/eepp/core/string.hpp index 227768bcb..390df9813 100644 --- a/include/eepp/core/string.hpp +++ b/include/eepp/core/string.hpp @@ -373,7 +373,17 @@ class EE_API String { bool res = result.ec == std::errc{} && result.ptr == end; return res; } else { - static_assert( false, "String::fromString not implemented for this type" ); + std::istringstream iss( s ); + auto f = std::dec; + switch ( base ) { + case 8: + f = std::oct; + break; + case 16: + f = std::hex; + break; + } + return !( iss >> f >> t ).fail(); } }