Date
2010-10-21.18:28:33
Message id
1781

Content

Proposed resolution:

Replace section [std.manip] except paragraph 1 with the following:

2- The type designated smanip in each of the following function descriptions is implementation-specified and may be different for each function.

smanip resetiosflags(ios_base::fmtflags mask);

-3- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves as if f(s, mask) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, mask) were called. The function f can be defined as:*

[Footnote: The expression cin >> resetiosflags(ios_base::skipws) clears ios_base::skipws in the format flags stored in the basic_istream<charT,traits> object cin (the same as cin >> noskipws), and the expression cout << resetiosflags(ios_base::showbase) clears ios_base::showbase in the format flags stored in the basic_ostream<charT,traits> object cout (the same as cout << noshowbase). --- end footnote]

     ios_base& f(ios_base& str, ios_base::fmtflags mask)
   {
   // reset specified flags
   str.setf(ios_base::fmtflags(0), mask);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out. The expression in>>s has type basic_istream<charT,traits>& and value in.

 smanip setiosflags(ios_base::fmtflags mask);

-4- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves as if f(s, mask) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, mask) were called. The function f can be defined as:

     ios_base& f(ios_base& str, ios_base::fmtflags mask)
   {
   // set specified flags
   str.setf(mask);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out. The expression in>>s has type basic_istream<charT,traits>& and value in.

smanip setbase(int base);

-5- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves as if f(s, base) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, base) were called. The function f can be defined as:

     ios_base& f(ios_base& str, int base)
   {
   // set basefield
   str.setf(base == 8 ? ios_base::oct :
   base == 10 ? ios_base::dec :
   base == 16 ? ios_base::hex :
   ios_base::fmtflags(0), ios_base::basefield);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out. The expression in>>s has type basic_istream<charT,traits>& and value in.

smanip setfill(char_type c);

-6- Returns: An object s of unspecified type such that if out is (or is derived from) basic_ostream<charT,traits> and c has type charT then the expression out<<s behaves as if f(s, c) were called. The function f can be defined as:

      template<class charT, class traits>
   basic_ios<charT,traits>& f(basic_ios<charT,traits>& str, charT c)
   {
   // set fill character
   str.fill(c);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out.

smanip setprecision(int n);

-7- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves as if f(s, n) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, n) were called. The function f can be defined as:

      ios_base& f(ios_base& str, int n)
   {
   // set precision
   str.precision(n);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out. The expression in>>s has type basic_istream<charT,traits>& and value in
.
smanip setw(int n);

-8- Returns: An object s of unspecified type such that if out is an instance of basic_ostream<charT,traits> then the expression out<<s behaves as if f(s, n) were called, or if in is an instance of basic_istream<charT,traits> then the expression in>>s behaves as if f(s, n) were called. The function f can be defined as:

      ios_base& f(ios_base& str, int n)
   {
   // set width
   str.width(n);
   return str;
   }

The expression out<<s has type basic_ostream<charT,traits>& and value out. The expression in>>s has type basic_istream<charT,traits>& and value in.