How to add indention to the stream operator

前端 未结 4 1226
予麋鹿
予麋鹿 2020-12-31 05:02

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:

         


        
4条回答
  •  伪装坚强ぢ
    2020-12-31 05:15

    You can make your own stream class that has an indentation variable and override the endl for that class, inserting the indentation.

提交回复
热议问题