Previously, I used to use MFC collection classes such CArray
and CMap
. After a while I switched to STL containers and have been using them for a while.
MFC containers derive from CObject
and CObject
has the assignment operator made private. I have found this very annoying in practice.
std::vector
, unlinke CArray, guarantees that the memory block is contiguous, thus you can interop with C programming interfaces easily:
std::vector buffer;
char* c_buffer = &*buffer.begin();