What does the 'operator' mean in this C++ usage?
char* pszV开发者_Go百科ar= W2A(_bstr_t(bstrVar).operator wchar_t*());
forcing the compiler to choose the, apparently defined, "convert to wchar_t*" operator in that class. "that class" being whatever is returned from the _bstr_t call.
That's an explicit call to the convertion operator to wchar_t
, to be sure it's this one that will be used and not another.
That said, that's ugly and certainly show a problem in the class members.
It marks an explicit call to the conversion operator to wchar_t*
.
It refers to the the casting operator.
精彩评论