810. Missing traits dependencies in operational semantics of extended manipulators

Section: 31.7.8 [ext.manip] Status: C++11 Submitter: Daniel Krügler Opened: 2008-03-01 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [ext.manip].

View all issues with C++11 status.

Discussion:

The recent draft (as well as the original proposal n2072) uses an operational semantic for get_money ([ext.manip]/4) and put_money ([ext.manip]/6), which uses

istreambuf_iterator<charT>

and

ostreambuf_iterator<charT>

resp, instead of the iterator instances, with explicitly provided traits argument (The operational semantic defined by f is also traits dependent). This is an obvious oversight because both *stream_buf c'tors expect a basic_streambuf<charT,traits> as argument.

The same problem occurs within the get_time and put_time semantic where additional to the problem we have an editorial issue in get_time (streambuf_iterator instead of istreambuf_iterator).

[ Batavia (2009-05): ]

This appears to be an issue of presentation.

We agree with the proposed resolution. Move to Tentatively Ready.

Proposed resolution:

In 31.7.8 [ext.manip]/4 within function f replace the first line

template <class charT, class traits, class moneyT> 
void f(basic_ios<charT, traits>& str, moneyT& mon, bool intl) { 
   typedef istreambuf_iterator<charT, traits> Iter;
   ...

In 31.7.8 [ext.manip]/5 remove the first template charT parameter:

template <class charT, class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);

In 31.7.8 [ext.manip]/6 within function f replace the first line

template <class charT, class traits, class moneyT> 
void f(basic_ios<charT, traits>& str, const moneyT& mon, bool intl) { 
  typedef ostreambuf_iterator<charT, traits> Iter;
  ...

In 31.7.8 [ext.manip]/8 within function f replace the first line

template <class charT, class traits> 
void f(basic_ios<charT, traits>& str, struct tm *tmb, const charT *fmt) { 
  typedef istreambuf_iterator<charT, traits> Iter;
  ...

In 31.7.8 [ext.manip]/10 within function f replace the first line

template <class charT, class traits> 
void f(basic_ios<charT, traits>& str, const struct tm *tmb, const charT *fmt) { 
  typedef ostreambuf_iterator<charT, traits> Iter;
  ...

In 31.7 [iostream.format], Header <iomanip> synopsis change:

template <class charT, class moneyT> T8 put_money(const moneyT& mon, bool intl = false);