The easiest way to implement a type-safe collection that contains objects of any type is to use one of the MFC template-based classes. For examples of these classes, see the MFC sample COLLECT.
The following table lists the MFC template-based collection classes.
Collection Template Classes
Collection contents | Arrays | Lists | Maps |
---|---|---|---|
Collections of objects of any type | CArray | CList | CMap |
Collections of pointers to objects of any type | CTypedPtrArray | CTypedPtrList | CTypedPtrMap |
If your application already uses MFC nontemplate classes, you can continue to use them. However, for new collections, we recommend that you use the template-based classes. The following table lists the MFC collection classes that are not based on templates.
Nontemplate Collection Classes
Arrays | Lists | Maps |
---|---|---|
CObArray | CObList | CMapPtrToWord |
CByteArray | CPtrList | CMapPtrToPtr |
CDWordArray | CStringList | CMapStringToOb |
CPtrArray |
| CMapStringToPtr |
CStringArray |
| CMapStringToString |
CWordArray |
| CMapWordToOb |
CUIntArray |
| CMapWordToPtr |
///531,
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
Thread Safety (스레드 안전) Interlocked. 함수들. (0) | 2016.01.12 |
---|---|
Thread Local Storage(스레드 로컬 스토리지) (0) | 2016.01.12 |
ATL Collection Classes (0) | 2015.12.28 |
정수형 signed, unsigned 8, 16, 32, 64비트별 값 표현 범위. (0) | 2015.12.24 |
char*, const char*, char* const (0) | 2015.12.23 |
댓글