> Perhaps, the moneypunct<> facet should have had 3 members:
> WIth the existing design, it looks like a member (neg_format()) is being used for something it wasn't meant for
A plausible approach might have been:
if( the input matches neg_format ) extract a negative monetary amount.
else if( the input matches pos_format ) extract a positive monetary amount.
else put the stream into the appropriate failed/eof state.
However, this is not really feasible, as per the current specification; std::istreambuf_iterator<> (the default specified by the standard) is a single-pass input iterator.