template <size_t B, class D = /* biggest digit type */>
constexpr fwnbi::basic_integer<B, D, false> strtoull(
const char* str, char** end, int base) noexcept;
template <size_t B, class D = /* biggest digit type */>
constexpr fwnbi::basic_integer<B, D, true> strtoll(
const char* str, char** end, int base) noexcept;
constexpr since C++14
Converts a C-string to integer from base in range [2, 36].
Semantic and expected behaviour as well as standard std::strtoull and std::strtoll.
Example
#include "fwnbi.hpp"
#include <iostream>
int main() {
char* tail = nullptr;
fwnbi::uint128_t value = std::strtoull<128>(" 0000012345jrl", &tail, 16);
std::cout << "Received value: " << value << '\n';
std::cout << "String tail: " << tail << '\n';
}
Output
Received value: 74565
String tail: jrl