put_moneyshould be formatted I/O functions
Section: 30.7.7 [ext.manip] Status: CD1 Submitter: Martin Sebor Opened: 2007-06-22 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [ext.manip].
View all issues with CD1 status.
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 implements
put_moneyshould 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.
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.
Add a new paragraph immediately above p4 of 30.7.7 [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 184.108.40.206.1 [istream.formatted.reqmts]).
Also change p4 of 30.7.7 [ext.manip] as follows:
Returns: An object
sof unspecified type such that if
inis an object of type
basic_istream<charT, traits>then the expression
in >> get_money(mon, intl)behaves as
f(in, mon, intl)
were called. The function
fcan 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.