This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Draft patch for libstdc++/21209


> Basically, the idea is using *only* unsigned types in
> the main parsing loop. In order to do that, I construct, via the
> auxiliary template __to_unsigned_type, an unsigned type suited for each
> signed type that we have to process (e.g., for long -> unsigned long),
> then, at the end, I adjust the sign and assign the number to the "return
> value" __v. Performance seems ok, even a tad (2-3%) faster than the
> current code, and regression tests + some additional tests seems ok,
> indeed. If nobody finds any serious flaw, I will go ahead along this
> way, adding maybe a comment and a generic additional num_get testcase
> exercising the parsing of numeric_limits<>::max and min.

This certainly looks sane to me.

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]