Why STL containers are preferred over MFC containers?

后端 未结 13 1629
时光说笑
时光说笑 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:29

    STL containers:

    • Have performance guarantees
    • Can be used in STL algorithms which also have performance guarantees
    • Can be leveraged by third-party C++ libraries like Boost
    • Are standard, and likely to outlive proprietary solutions
    • Encourage generic programming of algorithms and data structures. If you write new algorithms and data structures that conform to STL you can leverage what STL already provides at no cost.

提交回复
热议问题