Does the standard define which iomanip
manipulators are sticky and which are not?
I keep finding myself referring to: https://stackoverflow.com/a/1533222/2642059
Which, is a great answer, but even says:
on my version
This coupled with the fact that I cannot find the concept of sticky on http://en.cppreference.com or http://www.cplusplus.com leads me to wonder whether this is an implementation defined concept.
Not "official", but cppreference.com says, in std::setw
The width property of the stream will be reset to zero (meaning "unspecified") if any of the following functions are called:
Input
Output
Overloads 1-7 of
basic_ostream::operator<<()
(at Stage 3 ofnum_put::put()
) (1-7 are the integer, boolean, and pointer overloads)
operator<<(basic_ostream&, char)
andoperator<<(basic_ostream&, char*)
std::put_money
(insidemoney_put::put()
)
std::quoted
(when used with an output stream)
As the edit history in cppreference says, this list was compiled by grepping the standard draft for "width"
All other manipulators are "sticky", as in, the stream state changes they perform persist until explicitly changed again.