FIX: C2676 on Overloaded Operators of Templated Classes (130370)
The information in this article applies to:
This article was previously published under Q130370 SYMPTOMS
When a templated class is not instantiated, but its member operators are
referenced, the following error is generated:
error C2676: [binary/unary] '<op>' : 'class [ClassName]<temp type>'
does not define this operator or a conversion to a type acceptable
to the predefined operator.
NOTE: The line number referenced by the error message refers to the point
where the operator is referenced (called), not the operator's definition.
RESOLUTION
The template class must be instantiated for the particular data type being
referenced (< class T> below). This instantiation can be accomplished in
one of two ways:
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was fixed in Microsoft
Visual C++, 32-bit Edition, version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix KB130370 |
---|
|