How to add indention to the stream operator
问题 In our project we use the c++ stream operator (<<) in our object model to print out an easy readible format of the data. A simplified example is this: std::ostream& operator<<(std::ostream & oStream, const OwnClass& iOwnClass) { oStream << "[SomeMember1: " << iOwnClass._ownMember1 << "]\n"; oStream << "[SomeMember2: " << iOwnClass._ownMember2 << "]\n"; } Resulting in this in the logging: [SomeMember1: foo] [SomeMember2: bar] What we want now is to be able to indent the result of that operator