On what grounds? It does not violate encapsulation. Use of "friend" can be justified, if you need to grant access to a class or function. Friend classes can be justified if they are meant to be coupled (any changes to one class implies changes to another class as well).