Namespaces
Variants
Views
Actions

Input/output manipulators

From cppreference.com
< cpp‎ | io
Revision as of 16:23, 2 November 2012 by P12bot (Talk | contribs)

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.

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.

Template:cpp/io/manip/dcl list boolalphaTemplate:cpp/io/manip/dcl list showbaseTemplate:cpp/io/manip/dcl list showpointTemplate:cpp/io/manip/dcl list showposTemplate:cpp/io/manip/dcl list skipwsTemplate:cpp/io/manip/dcl list uppercaseTemplate:cpp/io/manip/dcl list unitbufTemplate:cpp/io/manip/dcl list leftTemplate:cpp/io/manip/dcl list hexTemplate:cpp/io/manip/dcl list fixedTemplate:cpp/io/manip/dcl list wsTemplate:cpp/io/manip/dcl list endsTemplate:cpp/io/manip/dcl list flushTemplate:cpp/io/manip/dcl list endlTemplate:cpp/io/manip/dcl list resetiosflagsTemplate:cpp/io/manip/dcl list setiosflagsTemplate:cpp/io/manip/dcl list setbaseTemplate:cpp/io/manip/dcl list setfillTemplate:cpp/io/manip/dcl list setprecisionTemplate:cpp/io/manip/dcl list setwTemplate:cpp/io/manip/dcl list get moneyTemplate:cpp/io/manip/dcl list put moneyTemplate:cpp/io/manip/dcl list get timeTemplate:cpp/io/manip/dcl list put time
Defined in header <ios>
Defined in header <istream>
Defined in header <ostream>
Defined in header <iomanip>