Some of the standard iomanip
functions take take a parameter.
I'd like to know how this is accomplished, for instance, can I do something similar with a function? That's really the solution that I needed for this answer, but I couldn't figure out how to do this.
When I looked up the definition for setw
function for example in http://en.cppreference.com it lists the return type as "unspecified", and it also only lists one argument, rather than also taking a stream&
parameter. How does this work?
Note to the reader:
This question has an excellent answer but to the individual looking up this question; this answer will only be useful in combination with the following functionality provided by ios_base
:
operator<<()
/operator>>()
overloads for these. – Landmasswidth
member function acting as an accessor and mutator. As far as I know, custom additions pretty much have to usexalloc
et. al. – Boettcherxalloc
madness of which you speak? I read cplusplus.com's description of thexalloc
but that really didn't clarify anything for me. – Riverspword
page has an example, as does cppreference. – Boettcher