|
-
October 22nd, 2002, 02:12 PM
#1
operator= with base type as lhs
Ok, this example is in Stroustrup C++ 3rd ed.:
complex operator+ (double a, complex b)
{
...
}
But when I have this code:
float& operator= (float& lhs, const EnumType& rhs)
{
lhs = rhs.getInt();
return lhs;
}
I get this error:
'operator =' must be a <Unknown> member
Any ideas why this is happening?
-Talix
P.S. For those of you looking at my other question, I assumed that using the base class EnumType was ok for this one, even though operator= functions aren't inherited, because this is not a member function, and so should work for all subclass types, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|