I am using STL in containers like:
std::vector< CComBSTR >
std::vector< CComPtr >
std::map< CComBSTR, CComPtr >
and so on
Until now I have not reach any problems with that. But I have read
recently on this list that I have to use "CAdapt", when I want to store
spart pointers in STL containers. But as I said, I have not had any
problems yet.
So my question is: Am I have to use "CAdapt" when storing smart pointers
after all. Right now I only store\search for items in the containers.
Cheers
--
Rossen Tzonev
Sofia, Bulgaria
According to the C++ standard, you must use CAdapt with classes that
overload operator& (both CComPtr and CComBSTR do). Depending on the
implementation and the exact container you use, you are more or less
likely to run into problems in practice. For examples of such problems,
see
http://groups.yahoo.com/group/wtl/message/10154
You may want to browse through the whole thread here:
http://groups.yahoo.com/group/wtl/message/10150
--
With best wishes,
Igor Tandetnik
"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage