f points to a memory location which have the value of the node so when we do *f it will return the value right?
But the return type of the function is T&.
Can you please explain
Why we are returning *f?
Hey @Sachita3 , Hope you are doing well
In the video the & is used to make sure that the operator is overloaded even after the function call is finished .
The return type is passed as reference and but the return value is still T .
So when we return *f we are returning value of T type .
The & after T only ensures that the operator remains overloaded even after the function call is finished all the operator overloading functions has that & in them . hope you get my point .
If you have any further doubts you can ask here .
Happy Coding !