QUtil::string_to_ull(char const* str)
{
    char const* p = str;
    while (*p && is_space(*p))
    {
        ++p;
    }
    if (*p == '-')
    {
        throw std::runtime_error(
            std::string("underflow converting ") + str
            + " to 64-bit unsigned integer");
    }

    errno = 0;
#ifdef _MSC_VER
    unsigned long long result = _strtoui64(str, 0, 10);
#else
    unsigned long long result = strtoull(str, 0, 10);
#endif
    if (errno == ERANGE)
    {
        throw std::runtime_error(
            std::string("overflow converting ") + str
            + " to 64-bit unsigned integer");
    }
    return result;
}
QUtil::string_to_ull(char const* str)
{
    char const* p = str;
    while (*p && is_space(*p))
    {
        ++p;
    }
    if (*p == '-')
    {
        throw std::runtime_error(
            std::string("underflow converting ") + str
            + " to 64-bit unsigned integer");
    }

    errno = 0;
#ifdef _MSC_VER
    unsigned long long result = _strtoui64(str, 0, 10);
#else
    unsigned long long result = strtoull(str, 0, 10);
#endif
    if (errno == ERANGE)
    {
        throw std::runtime_error(
            std::string("overflow converting ") + str
            + " to 64-bit unsigned integer");
    }
    return result;
}