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. Although I find STL much better, I am unable to pin point the exact reasons for it. Some of the reasoning such as :
- It requires MFC: does not hold because other parts of my program uses MFC
- It is platform dependent: does not hold because I run my application only on windows.(No need for portability)
- It is defined in the C++ standard: OK, but MFC containers still work
The only reason I could come up is that I can use algorithms on the containers. Is there any other reason that I am missing here - what makes STL containers better than MFC containers?
or add iterators to them
. I understand why it's not removed, but ppl should stop implementing new stuff with them. It also wouldn't cost MS that much to add iterators to those containers to help those using legacy stuff to write better code with minimal risk.. Also please replaceis just
withinstead of
in my last post, I must have typed it on my phone and got auto-corrected.