DOC: Smart Pointers Example Is Incorrect (123603)
The information in this article applies to:
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 4.0
- Microsoft Visual C++ 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q123603 SUMMARY
The Smart Pointers sample code uses C++ templates to create generic
wrappers to encapsulate pointers of almost any type. The sample
encapsulates pointers and overrides pointer operators to add new
functionality to pointer operations. However, the Smart Pointers sample
code in the documentation contains the following errors: - stdio.h is not included and TRACE is not defined.
- Operator Ptr& operator=(Ptr<T> &p_) is missing.
- Implementation for operator Ptr& operator=(T* p_) is incorrect.
The Smart Pointers sample code may be found in "Templates" chapter of
"Programming Techniques" included in the Visual C++ Books Online. Searching
for "Smart Pointers" in search plus of the Books Online also brings you to
the sample.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbdocerr KB123603 |
---|
|