MCPcopy Create free account
hub / github.com/boostorg/parser / to_int

Function to_int

include/boost/parser/tuple.hpp:38–51  ·  view source on GitHub ↗

to_int() and parse_llong() taken from boost/hana/bool.hpp.

Source from the content-addressed store, hash-verified

36 namespace detail {
37 // to_int() and parse_llong() taken from boost/hana/bool.hpp.
38 constexpr int to_int(char c)
39 {
40 int result = 0;
41
42 if (c >= 'A' && c <= 'F') {
43 result = static_cast<int>(c) - static_cast<int>('A') + 10;
44 } else if (c >= 'a' && c <= 'f') {
45 result = static_cast<int>(c) - static_cast<int>('a') + 10;
46 } else {
47 result = static_cast<int>(c) - static_cast<int>('0');
48 }
49
50 return result;
51 }
52
53 template<std::size_t N>
54 constexpr long long parse_llong(const char (&arr)[N])

Callers 1

parse_llongFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected