overloading operator= vs conversion operator

Hi all.
Can someone please explain to me how the c++ compiler handles conversions between user-defined types and basic types, and vice versa, and how an overloaded assignment operator affects the conversion?

For example if i have a class APP, and a corresponding object APP_obj :

1
2
3
int i,j;
APP_obj = i;
j = APP_obj;


Is the overloaded assignment operator called to handle the assignments or is the conversion operator function?

Please explain or refer me to any site that discusses the relationship between assignment and conversion. I googled but didn't get anything appropriate :( !

Thanks.

Last edited on
Your = operator is called on the first one (since your object is on the left) and the second one the conversion is called because j is on the left (wanting an int/double/whatever on the right).
Topic archived. No new replies allowed.