Reputation: 51
I need to use tree structure inside a ATL COM server. I thought of using stl::map<> for this purpose as follows.
BaseMap[k1,NextLevelMap[k2, NextLevelMap[k3, Value]]]
But I need to know, whether using such a structure inside ATL is safe and possibility of debugging support with maps.
Thank you
Upvotes: 2
Views: 685
Reputation: 13182
C++ standard library classes are safe to use with ATL - ATL even includes a couple of classes specifically designed to interface with containers following standard library conventions: ICollectionOnSTLImpl
and CComEnumOnSTL
.
Debugging is also fine - the Visual Studio debugger hides the implementation of the standard containers and instead shows a logical view of what they contain.
Upvotes: 6
Reputation: 170469
STL classes are ordinary classes, nothing special. You can use them in COM servers provided you take care of multithreading issues - the stuff called "apartments", since STL classes are not thread-safe by themselves.
You can debug STL classes just like all other classes provided you compile the project appropriately - with debug information enabled.
Upvotes: 4