Skip to content

Commit 1ac9d3d

Browse files
committed
restore char_to_digit
1 parent 56594fe commit 1ac9d3d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/glaze/toml/read.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,14 @@ namespace glz
375375
return is_any_toml_digit(c);
376376
}
377377

378+
constexpr int char_to_digit(char c) noexcept
379+
{
380+
if (c >= '0' && c <= '9') return c - '0';
381+
if (c >= 'a' && c <= 'z') return c - 'a' + 10;
382+
if (c >= 'A' && c <= 'Z') return c - 'A' + 10;
383+
return -1;
384+
}
385+
378386
struct unsigned_accumulator
379387
{
380388
private:

0 commit comments

Comments
 (0)