Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error e2093: how to avoid it?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hello,
i hope someone of u can help me...
i've written my vector class and wanted to compile a test program with bcc32 (5.5)!
here is the problem:
i get error e2093 when trying to test the following expression:
a+(b+a); /*a and b are vector objects*/
i've overloaded the + operator for the vector and i've written a sum method:

cls_vector mth_sum(cls_vector &vector_2);
cls_vector operator+(cls_vector &vector_2);
the methods are identical!

if i try to compile:
a.mth_sum(b+a);
everything works fine but not if i write
a+(b+a);
i don't understand why i get the error:
"E2093 Operator 'operator' not implemented in type 'type' for arguments of the same type"!
perhaps someone has a solution for this...
thanks!
 
i would assume it's because you did not declare operator+() as a 'friend' to your class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top