[std.manip] (original) (raw)

31 Input/output library [input.output]

31.7 Formatting and manipulators [iostream.format]

31.7.7 Standard manipulators [std.manip]

The header defines several functions that support extractors and inserters that alter information maintained by classios_base and its derived classes.

_unspecified_ resetiosflags(ios_base::fmtflags mask);

Returns: An object of unspecified type such that if out is an object of typebasic_ostream<charT, traits> then the expressionout << resetiosflags(mask) behaves as if it calledf(out, mask), or if in is an object of typebasic_istream<charT, traits> then the expressionin >> resetiosflags(​mask) behaves as if it calledf(in, mask), where the function fis defined as:292 void f(ios_base& str, ios_base::fmtflags mask) { str.setf(ios_base::fmtflags(0), mask);}

The expression out << resetiosflags(mask) has type basic_ostream<charT, traits>& and value out.

The expression in >> resetiosflags(mask) has typebasic_istream<charT, traits>& and value in.

_unspecified_ setiosflags(ios_base::fmtflags mask);

Returns: An object of unspecified type such that ifoutis an object of typebasic_ostream<charT, traits>then the expressionout << setiosflags(mask)behaves as if it calledf(out, mask), or ifinis an object of typebasic_istream<charT, traits>then the expressionin >> setiosflags(mask)behaves as if it calledf(in, mask), where the function f is defined as:void f(ios_base& str, ios_base::fmtflags mask) { str.setf(mask);}

The expressionout << setiosflags(mask)has typebasic_ostream<charT, traits>&and valueout.

The expressionin >> setiosflags(mask)has typebasic_istream<charT, traits>&and valuein.

_unspecified_ setbase(int base);

Returns: An object of unspecified type such that ifoutis an object of typebasic_ostream<charT, traits>then the expressionout << setbase(base)behaves as if it calledf(out, base), or ifinis an object of typebasic_istream<charT, traits>then the expressionin >> setbase(base)behaves as if it calledf(in, base), where the function f is defined as:void f(ios_base& str, int base) { str.setf(base == 8 ? ios_base::oct : base == 10 ? ios_base::dec : base == 16 ? ios_base::hex : ios_base::fmtflags(0), ios_base::basefield);}

The expressionout << setbase(base)has typebasic_ostream<charT, traits>&and valueout.

The expressionin >> setbase(base)has typebasic_istream<charT, traits>&and valuein.

_unspecified_ setfill(char_type c);

Returns: An object of unspecified type such that ifoutis an object of typebasic_ostream<charT, traits>and c has typecharTthen the expressionout << setfill(c)behaves as if it calledf(out, c), where the function f is defined as:template<class charT, class traits> void f(basic_ios<charT, traits>& str, charT c) { str.fill(c);}

The expressionout << setfill(c)has typebasic_ostream<charT, traits>&and valueout.

_unspecified_ setprecision(int n);

Returns: An object of unspecified type such that ifoutis an object of typebasic_ostream<charT, traits>then the expressionout << setprecision(n)behaves as if it calledf(out, n), or ifinis an object of typebasic_istream<charT, traits>then the expressionin >> setprecision(n)behaves as if it calledf(in, n), where the function f is defined as:void f(ios_base& str, int n) { str.precision(n);}

The expressionout << setprecision(n)has typebasic_ostream<charT, traits>&and valueout.

The expressionin >> setprecision(n)has typebasic_istream<charT, traits>&and valuein.

Returns: An object of unspecified type such that ifoutis an instance ofbasic_ostream<charT, traits>then the expressionout << setw(n)behaves as if it calledf(out, n), or ifinis an object of typebasic_istream<charT, traits>then the expressionin >> setw(n)behaves as if it calledf(in, n), where the function f is defined as:void f(ios_base& str, int n) { str.width(n);}

The expressionout << setw(n)has typebasic_ostream<charT, traits>&and valueout.

The expressionin >> setw(n)has typebasic_istream<charT, traits>&and valuein.