Why is there a different string class in every C++ platform out there?

前端 未结 7 2078
北荒
北荒 2020-12-31 08:02

While I like programming in C++, I hate the idea of:
std::basic_string vs QString vs wxString vs .............
Doesn\'t the

7条回答
  •  没有蜡笔的小新
    2020-12-31 08:31

    One reasonable reason (versus unreasonable reasons like "I don't want to learn the Standard Library") is that some libraries wish to retain control over the binary layout, in order to achieve certain kinds of interoperability (such as binary compatibility across versions). An example of this is _bstr_t in the VC++ libraries; it is important for COM purposes that a _bstr_t is represented as a BSTR (since that is what COM needs), so a wrapper built on top of a BSTR is valuable to COM developers.

提交回复
热议问题