Converting strstream to sstream conflict about c_str()

后端 未结 2 1393
执念已碎
执念已碎 2021-01-26 13:53

I have this code block as written with strstream. And I converted it to sstream as below. I\'m not sure, but I think printStream->str()

2条回答
  •  孤街浪徒
    2021-01-26 14:31

    I think a function called to_string really, really, really should return a std::string.

    And then all this junk can be replaced by

    std::string FieldData::to_string() const
    { return "Invalid Field Type"; }
    

提交回复
热议问题