15 #if __has_include(<charconv>)
31 auto ToInt = [enums](
const std::string& str,
auto& result) ->
bool {
34 auto it = enums->find(str);
35 if(it != enums->end())
41 #if __cpp_lib_to_chars >= 201611L
42 auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
43 return (ec == std::errc());
47 result = std::stoi(str);
58 if(ToInt(v1, v1_int) && ToInt(v2, v2_int) && v1_int == v2_int)
63 auto ToReal = [](
const std::string& str,
auto& result) ->
bool {
64 #if __cpp_lib_to_chars >= 201611L
65 auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
66 return (ec == std::errc());
70 result = std::stod(str);
81 constexpr
auto eps = double(std::numeric_limits<float>::epsilon());
82 if(ToReal(v1, v1_real) && ToReal(v2, v2_real) && std::abs(v1_real - v2_real) <= eps)