Topic: basic_stream extraction and width


Author: gennaro_prota@yahoo.com (Gennaro Prota)
Date: Sat, 19 Jul 2003 19:44:03 +0000 (UTC)
Raw View
The description of the basic_string extractor in 21.3.7.9 says, after
listing some conditions that cause extraction to terminate,

  "After the last character (if any) is extracted, is.width(0) is
   called and the sentry object k is destroyed."

I wonder a few things about it. First of all, what does "after" the
last character is extracted mean? What if bool(k) is false? Can an
implementation reset the width in that case? And what if an exception
is thrown during the sentry construction? Also, I don't understand
whether "if any" is meant to say that width(0) is called even if no
characters are extracted (i.e. that we pretend there's a "last
character" anyway) or the contrary of that.

Can anyone clarify the intent? I'm writing the extractor for a UDT and
I would like it to mimic the string extractor behavior, but frankly I
don't know where to put the call width(0).


Genny.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]