This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Draft patch for libstdc++/21209
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 27 Apr 2005 11:28:23 -0500
- Subject: Re: Draft patch for libstdc++/21209
- Organization: Red Hat / Chicago
- References: <426D3B9E.1060800@suse.de>
> 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