开发者

meaning of 'operator' in this C++ statement

开发者 https://www.devze.com 2023-01-03 23:50 出处:网络
What does the \'operator\' mean in this C++ usage? char* pszV开发者_Go百科ar= W2A(_bstr_t(bstrVar).operator wchar_t*());

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消