版本比较
感性理解 cin 速度
正文
增加 7 行删除 7 行
53 行未改动5455565758585960616227 行未改动9091929394949596979820 行未改动11912012112212312312412512612712812913013113213313313413513613725 行未改动1631641651661671671681691701715 行未改动17717817918018118118218318418518618718718818919019192 行未改动53 行未改动 { if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) || __c == __lc->_M_decimal_point) break; else if (__c == __lit[__num_base::_S_izero] else if (__c == __lit[__num_base::_S_izero] && (!__found_zero || __base == 10)) { __found_zero = true; ++__sep_pos;27 行未改动 } else __testeof = true; }
// At this point, base is determined. If not hex, only allow // base digits as valid input. const size_t __len = (__base == 16 ? __num_base::_S_iend - __num_base::_S_izero : __base);20 行未改动 { __digit = _M_find(__lit_zero, __len, __c); if (__digit == -1) break;
if (__result > __smax) __testoverflow = true; else { __result *= __base; __testoverflow |= __result > __max - __digit; __result += __digit; ++__sep_pos; }
if (++__beg != __end) __c = *__beg; else __testeof = true;25 行未改动 const char_type* __q = __traits_type::find(__lit_zero, __len, __c); if (!__q) break;
__digit = __q - __lit_zero; if (__digit > 15) __digit -= 6; if (__result > __smax)5 行未改动 __result += __digit; ++__sep_pos; } }
if (++__beg != __end) __c = *__beg; else __testeof = true; }
// Digit grouping is checked. If grouping and found_grouping don't // match, then get very very upset, and set failbit. if (__found_grouping.size()) {92 行未改动