איזה יופי!
אני מתכוון לדרך המימוש שניתנה בסטנדרט:
New iostream manipulators are easy to implement because the most important part has already been done by the standardization committee when they included the basic_ostream& operator<<( basic_ostream& (*pf)(basic_ostream&)); overload in the standard. Thus, any function with the correct signature can be used as a stream manipulator:
נקי ואלגנטי.