This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
get_money
and put_money
should be formatted I/O functionsSection: 31.7.8 [ext.manip] Status: CD1 Submitter: Martin Sebor Opened: 2007-06-22 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [ext.manip].
View all issues with CD1 status.
Discussion:
In a private email Bill Plauger notes:
I believe that the function that implements
get_money
[from N2072] should behave as a formatted input function, and the function that implementsput_money
should behave as a formatted output function. This has implications regarding the skipping of whitespace and the handling of errors, among other things.The words don't say that right now and I'm far from convinced that such a change is editorial.
Martin's response:
I agree that the manipulators should handle exceptions the same way as formatted I/O functions do. The text in N2072 assumes so but the Returns clause explicitly omits exception handling for the sake of brevity. The spec should be clarified to that effect.
As for dealing with whitespace, I also agree it would make sense for the extractors and inserters involving the new manipulators to treat it the same way as formatted I/O.
Proposed resolution:
Add a new paragraph immediately above p4 of 31.7.8 [ext.manip] with the following text:
Effects: The expression
in >> get_money(mon, intl)
described below behaves as a formatted input function (as described in 31.7.5.3.1 [istream.formatted.reqmts]).
Also change p4 of 31.7.8 [ext.manip] as follows:
Returns: An object
s
of unspecified type such that ifin
is an object of typebasic_istream<charT, traits>
then the expressionin >> get_money(mon, intl)
behaves as a formatted input function that callsf(in, mon, intl)
were called. The functionf
can be defined as...
[ post Bellevue: ]
We recommend moving immediately to Review. We've looked at the issue and have a consensus that the proposed resolution is correct, but want an iostream expert to sign off. Alisdair has taken the action item to putt this up on the reflector for possible movement by Howard to Tenatively Ready.