Use of friend function seems like a little hack to me. Do friend functions violate the concept of encapsulation?
What are the alternatives to friend function? Will using a simple helper class/function along with setter & getter member functions help increase encapsulation in comparison with just using friend?