Which one to use C ++ stl container or MFC container?

For each stl container in Visual C ++, there is an MFC container that is better than the other, in what sense and what are you using?

I always use the STL container, is this wrong?

+3
source share
8 answers

MFC collection classes have certain advantages if you work within the MFC territory. For example. you get things like serialization (if your container elements are inherited from CObject or similar) and some debugging support for "free". MSDN has a breakdown of how to choose between the different types of MFC collections [here] ( http://msdn.microsoft.com/en-us/library/y1z022s1(VS.80).aspx) .

By default, I tend to STL classes.

+4
source

I would always prefer STL containers because of portability.

MFC containers will almost never be available on Linux.

Even if you do not plan to use your code on Linux ... you never know what the future brings.

+10
source

STL, , : . , , STL , . ? STL ++, , , -, STL, MFC, , - STL.

+10

:

", , . MFC . ++ , ++. MFC.

.

Vsual ++ "

+5

. STL Boost (www.boost.org).

+3

STL. .

+2

STL : , . : , Boost, . , Alexandrescu Modern ++ Design: . Boost STL .

- , , S TL: S tandard ", M FC M icrosoft". ++-, , STL, Microsoft MFC. , Microsoft MFC.

+1
source

Even when they show you numbers that MFC containers are faster, they can, without exception, make free double espressos: just close your eyes and use the DEL key (also the NO-LOCK-IN key).

You can do all this in a more portable way and in plagiaristic ways that you can only dream of. STL completely.

-1
source

Source: https://habr.com/ru/post/1708003/


All Articles