Title
get_money and put_money should be formatted I/O functions
Status
cd1
Section
[ext.manip]
Submitter
Martin Sebor

Created on 2007-06-22.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add a new paragraph immediately above p4 of [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 [istream.formatted.reqmts]).

Also change p4 of [ext.manip] as follows:

Returns: An object s of unspecified type such that if in is an object of type basic_istream<charT, traits> then the expression in >> get_money(mon, intl) behaves as a formatted input function that calls f(in, mon, intl) were called. The function f can be defined as...

Date: 2007-06-22.00:00:00

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_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.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3455
2007-06-22 00:00:00admincreate