Custom stream to method in C++?

后端 未结 5 526
星月不相逢
星月不相逢 2020-12-06 08:37

I\'m making a logger and I wish to have some kind of stream-like happenings going on, ideally doing CLogger << \"Testing, \" << 1 << \",2,3\\n\";

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 09:12

    All of the operator<<() functions are defined on the class ostream, which you can inherit from and implement its methods.

提交回复
热议问题