Input/output manipulators
Manipulators are helper functions that make it possible to control input/output streams using operator<< or operator>>.
The manipulators that are invoked without arguments (e.g. std::cout << std::boolalpha; or std::cin >> std::hex;) are implemented as functions that take a reference to a stream as their only argument. The special overloads of basic_ostream::operator<< and basic_istream::operator>> accept pointers to these functions. These functions (or instantiations of function templates) are the only addressable functions in the standard library. (since C++20)
The manipulators that are invoked with arguments (e.g. std::cout << std::setw(10);) are implemented as functions returning objects of unspecified type. These manipulators define their own operator<< or operator>> which perform the requested manipulation.
<ios> 헤더에 정의됨. | |
| switches between textual and numeric representation of booleans (function) | |
| controls whether prefix is used to indicate numeric base (function) | |
| controls whether decimal point is always included in floating-point representation (function) | |
controls whether the + sign used with non-negative numbers (function) | |
| controls whether leading whitespace is skipped on input (function) | |
| controls whether uppercase characters are used with some output formats (function) | |
| controls whether output is flushed after each operation (function) | |
| sets the placement of fill characters (function) | |
| changes the base used for integer I/O (function) | |
(C++11) (C++11) |
changes formatting used for floating-point I/O (function) |
<istream> 헤더에 정의됨. | |
| consumes whitespace (function template) | |
<ostream> 헤더에 정의됨. | |
outputs '\0' (function template) | |
| flushes the output stream (function template) | |
outputs '\n' and flushes the output stream (function template) | |
(C++20) |
스트림의 basic_syncbuf 에서 flush 할 때 전체 데이터를 한 번에 내보낼 지의 여부를 제어합니다 (function template) |
(C++20) |
스트림을 한 번에 비우고 basic_syncbuf에 담겨 있는 내용을 내보냅니다. (function template) |
<iomanip> 헤더에 정의됨. | |
| clears the specified ios_base flags (function) | |
| sets the specified ios_base flags (function) | |
| changes the base used for integer I/O (function) | |
| changes the fill character (function template) | |
| changes floating-point precision (function) | |
| changes the width of the next input/output field (function) | |
(C++11) |
parses a monetary value (function template) |
(C++11) |
formats and outputs a monetary value (function template) |
(C++11) |
parses a date/time value of specified format (function template) |
(C++11) |
formats and outputs a date/time value according to the specified format (function template) |
(C++14) |
inserts and extracts quoted strings with embedded spaces (function template) |