Why STL containers are preferred over MFC containers?

后端 未结 13 1609
时光说笑
时光说笑 2021-01-30 22:24

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.

13条回答
  •  日久生厌
    2021-01-30 22:54

    • Compatibility with other libraries (such as boost) in syntax, interoperability, and paradigm. It's a non-trivial benefit.
    • Using STL will develop a skillset that is more likely to be useful in other contexts. MFC isn't so widely used any more; STL is.
    • Using STL will develop a mindset that you may (or may not) find useful in code you write yourself.

    Using something other than STL isn't inherently wrong though.

提交回复
热议问题