G
grahamo
I have done this before but it keeps eluding me when I revisit it...
I have a class employee defined with;
friend employee operator+(const employee& e1, const employee& e2) ;
Now I know I can invoke that version of the operator by using
something like;
employee e1, e2;
employee e3 = operator+(e1,e2);
however I know there are other ways to have it invoked...thereby
illustrating its use. What other ways are there? I thought
employee e4 = e1+e2+e3;
would do the trick but that doesn't invoke it (using latest G++
compiler).
any help much appreciated.
cheers
GrahamO
I have a class employee defined with;
friend employee operator+(const employee& e1, const employee& e2) ;
Now I know I can invoke that version of the operator by using
something like;
employee e1, e2;
employee e3 = operator+(e1,e2);
however I know there are other ways to have it invoked...thereby
illustrating its use. What other ways are there? I thought
employee e4 = e1+e2+e3;
would do the trick but that doesn't invoke it (using latest G++
compiler).
any help much appreciated.
cheers
GrahamO