PRB: Errors Generated Overloading Operator New []
Article ID: 122305
Article Last Modified on 12/8/2003
APPLIES TO
- Microsoft Visual C++ 1.0 Professional Edition
- Microsoft Visual C++ 1.5 Professional Edition
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52 Professional Edition
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q122305
SYMPTOMS
The September 1994 ANSI C++ Draft specifies that it is possible to overload
the new [] operator. However, the Microsoft C/C++ compilers included in the
Microsoft products listed above do not support this feature. Microsoft
C/C++ version 7.0 and Visual C++ up to version 5.0 will generate the
following error message:
error C2092: array element type cannot be function
Microsoft Visual C++, 32-bit edition, version 5.0 generates two error
messages:
error C2039: 'new[]' : is not a member of '`global namespace''
error C2660: 'new[]' : function does not take 1 parameters
STATUS
This behavior is by design.
Additional query words: C2372 C2039 C2660
Keywords: kblangcpp kbprb KB122305