C++ Operator overloading example

前端 未结 3 1686
终归单人心
终归单人心 2021-01-25 19:08

Well, I\'m new to operator overloading, and I found this problem. Instead of documenting myself, I prefer to ask you :D

The point is, I know how to do simple operator ov

3条回答
  •  广开言路
    2021-01-25 19:53

    template 
    dxfdata & operator <<( dxfdata & d, const T & t ) {
       std::ostringstream os;
       os << t;
       d.b += os.str();
       return d;
    }
    

提交回复
热议问题