Article ID: 140604 - Last Review: July 5, 2005 - Revision: 1.1 FIX: 'using' Declaration Doesn't Overload Base Class MembersThis article was previously published under Q140604 On This PageSYMPTOMS
Attempting to overload member functions located in a base class from a
derived class with a 'using' declaration, may result in the following
compiler error:
error C2664: 'function': cannot convert parameter 'number' from
'type1' to 'type2'
CAUSE
This particular problem occurs if the member functions that are being
overloaded are declared before the 'using' declaration in the class
definition.
RESOLUTION
Place the 'using' declaration above the declarations for the member
functions you want to overload. See the comments in the following code
sample:
Sample CodeSTATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Microsoft Visual C++ .NET. REFERENCES
For more information on the 'using' declaration, please see:
\Visual C++ Books\C/C++\C++ Language\Reference\Declarations\
Namespaces\using Declaration
APPLIES TO
| Article Translations
|
Back to the top
