MCPcopy Create free account
hub / github.com/ashvardanian/less_slow.cpp / string_to_integer_or_variants

Function string_to_integer_or_variants

less_slow.cpp:6192–6198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6190}
6191
6192static expected<std::size_t> string_to_integer_or_variants( //
6193 std::string const &value, [[maybe_unused]] std::size_t iteration_index) noexcept {
6194 std::size_t integral_value = 0;
6195 std::from_chars_result result = std::from_chars(value.data(), value.data() + value.size(), integral_value);
6196 if (result.ec != std::errc()) return std::make_error_code(result.ec);
6197 return integral_value;
6198}
6199
6200static expected<std::string> integer_to_next_string_or_variants(std::size_t value,
6201 std::size_t iteration_index) noexcept {

Callers 1

errors_variantsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected