DOC: ConstructElements & DestructElements (138695)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q138695 SUMMARY The documentation (included with the products listed above)
for ConstructElements and DestructElements contains errors.
ConstructElements and DestructElements are two of the seven templated global
helper functions used by MFC's templated collection classes such as CArray,
CList, and CMap. ConstructElements is used to construct the elements stored in
the collection classes and DestructElements is used to destruct the elements
stored in the collection classes.
In Visual C++ 2.x, the MFC default
implementation of ConstructElements does a bit-wise zero initialization to all
the new elements, and the default implementation of DestructElements does
nothing.
In Visual C++ 4.0 through 6.0, the MFC default
implementation of ConstructElements not only does a bit-wise zero
initialization to all the new elements but also calls the stored objects'
constructors in a loop. This is different from the implementation in Visual C++
2.x, but the documentation was not changed. See the "More Information" section
in this article for the function implementation.
In addition, the
MFC default implementation of DestructElements in Visual C++ 4.0 through 6.0,
destructs the stored objects by calling their destructors. This is new in
Visual C++ 4.x. See the "More Information" section in this article for the
function implementation.
Modification Type: | Major | Last Reviewed: | 9/18/2003 |
---|
Keywords: | kbBug kbdocerr kbNoUpdate KB138695 |
---|
|