mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +08:00
🧹 utils: modernize floating point typetrait
This commit is contained in:
parent
f384932b58
commit
7bcd6bba4c
@ -83,7 +83,7 @@ inline T to_int(const std::string_view& str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T = double>
|
template <typename T = double>
|
||||||
requires std::is_floating_point<T>::value
|
requires std::is_floating_point_v<T>
|
||||||
inline T to_floating(const std::string_view& str) {
|
inline T to_floating(const std::string_view& str) {
|
||||||
T result = 0;
|
T result = 0;
|
||||||
std::from_chars(str.data(), str.data() + str.size(), result);
|
std::from_chars(str.data(), str.data() + str.size(), result);
|
||||||
|
Loading…
Reference in New Issue
Block a user