Пример #1
0
int toi(InIter &begin, InIter end, Traits const &traits, int radix = 10, int max = INT_MAX)
{
    int i = 0, c = 0;
    for(; begin != end && -1 != (c = traits.value(*begin, radix)); ++begin)
    {
        if(max < ((i *= radix) += c))
            return i / radix;
    }
    return i;
}
Пример #2
0
int toi(InIter &begin, InIter end, Traits const &tr, int radix = 10, int max = INT_MAX)
{
    detail::ignore_unused(tr);
    int i = 0, c = 0;
    for(; begin != end && -1 != (c = tr.value(*begin, radix)); ++begin)
    {
        if(max < ((i *= radix) += c))
            return i / radix;
    }
    return i;
}