It s been quite some time now that I ve been coding in C++ and I think most who actually code in C++, would agree that one of the most trickiest decisions is to choose from an almost dizzying number of string types available. I mostly prefer ATL Cstring
for its ease of use and features, but would like a comparative study of the available options.
I ve checked out SO and haven t found any content which assists one choosing the right string. There are websites which state conversions from one string to another, but thats not what we want here.
热衷于根据特殊性、性能、可携带性(Windows、Mac、LC/Unix等)、使用方便性/特性、多语文支持(Unicode/MBCS)、汇合(如果有)和其他任何特殊情况进行比较。
我罗列了我迄今为止所经历的str。 我认为,还会有更多的东西,因此,我们或许会 later忙这样做,以适应其他选择。 我先天主要在Windows上工作,因此名单也反映了同样的情况:
char*
std::string
- STL s
basic_string
- ATL s
CString
- MFC s
CString
BSTR
_bstr_t
CComBstr