Basic facilities
- slide 40 : 46
More manipulators
Manipulators can be with or without arguments
Manipulators without arguments
The manipulator is a
pointer to function
Handled by an operator overload of
operator<<
in class
basis_ostream
basis_ostream operator<<(basis_ostream& (*f)(basis_ostream&)){return f(*this)}
Manipulators with arguments
The manipulator
m(a)
returns an struct that aggregates a function pointer and the argument
a
An overload of
<<
activates the function on the argument before it returns the stream
Interesting details on page 633
Illustration of more manipulators.
Program output.