comparison include/core/strings.h @ 202:71832ffe425a

animia: re-add kvm fd source this is all being merged from my wildly out-of-date laptop. SORRY! in other news, I edited the CI file to install the wayland client as well, so the linux CI build might finally get wayland stuff.
author Paper <paper@paper.us.eu.org>
date Tue, 02 Jan 2024 06:05:06 -0500
parents bc8d2ccff09c
children 7cf53145de11
comparison
equal deleted inserted replaced
201:8f6f8dd2eb23 202:71832ffe425a
51 if constexpr (std::is_signed<T>::value) { 51 if constexpr (std::is_signed<T>::value) {
52 return clamp(std::stoll(str), std::numeric_limits<T>::min(), std::numeric_limits<T>::max()); 52 return clamp(std::stoll(str), std::numeric_limits<T>::min(), std::numeric_limits<T>::max());
53 } else if constexpr (std::is_unsigned<T>::value) { 53 } else if constexpr (std::is_unsigned<T>::value) {
54 return clamp(std::stoull(str), std::numeric_limits<T>::max(), std::numeric_limits<T>::max()); 54 return clamp(std::stoull(str), std::numeric_limits<T>::max(), std::numeric_limits<T>::max());
55 } else { 55 } else {
56 throw std::invalid_argument("it no worky"); 56 throw std::invalid_argument("Invalid input to Strings::ToInt()!");
57 } 57 }
58 } catch (std::invalid_argument const& ex) { 58 } catch (std::invalid_argument const& ex) {
59 return def; 59 return def;
60 } 60 }
61 } 61 }