Using overloaded operators on pointers

后端 未结 4 877
悲&欢浪女
悲&欢浪女 2021-02-19 15:28

I overloaded the << operator of a class. How do I have to overload the operator if I want to use it on pointers, like the following?

class A {
    std::str         


        
4条回答
  •  清歌不尽
    2021-02-19 15:36

    Normally there is no good reason doing that, because semantically operator << return reference to stream object. And technically you basically can't do that.

提交回复
热议问题