This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Silently passing wrong input for good one
Paolo Carlini wrote:
[...]
Definitely! Really, as long as we have such kind of wording, on
input_iterators, I don't see how you can avoid for the iterator to
advance past 'e' and past '-' during Stage2: of course, because
otherwise you wouldn't be able to parse a well-formed scientific number.
I don't see any other "legal" way, either. An implementation could
try to play some tricks with the iterator (like reaching inside and
scanning forward) but those would only work with its own iterators
and not even that would be completely reliable.
Actually, I'm not sure about the best way to fix the standard :( Maybe,
as you suggested, we can fix it for a specialization to pointers... I'm
afraid that as long as general input iterators are mentioned it's hard
to make progress.
I think the only other reasonable option (other than your current
behavior) is to fail (i.e., our behavior ;-)
Martin