Reputation: 1035
I have some source code with COM string manipulation but have this code is make me confused
_bstr_t btLeft;
_bstr_t tempData ;
_bstr_t btRight ;
//Do something to assign values to 3 above variables
.....
//And here
_bstr_t::operator = (btLeft + tempData + btRight); //confused!!!
return true
=> What is the meaning of this code?
_bstr_t::operator = (btLeft + tempData + btRight);
it's look like string concanate? which is returned value?
Upvotes: 0
Views: 112
Reputation: 11340
It's the same as the following:
const auto foo = btLeft + tempData + btRight;
this->_bstr_t::operator=(foo);
btLeft + tempData + btRight
adds together the three instances of _bstr_t
(see the documentation here). This does indeed concatenate the 3 strings.this->_bstr_t::operator=(foo);
takes the result of 1 and invokes the assignment operator (see also the documentation) of the base class which must be _bstr_t
.You could say it concatenates three strings and assigns the result to itself.
(All of this is under the assumption that Hasn Passant's crystal ball told him correctly, that your code is part of a member function of a class that inherits from _bstr_t
)
Upvotes: 1