So here's the thing. Today we had our exams (C++ of course). There was this question, Do friends violate encapsulation?
To be honest, I don't even really know what encapsulation is. I just know that encapsulation is something like merging data and function together as a single unit. But I'm not sure whether it is really true or not.
Now getting back to question, I cleverly answered in between. I started by writing that friends do violate encapsulation (I've a strong feeling that there should be data hiding instead of encapsulation, that is if they are not the same thing.) and gradually asserted that the safety of the data remains intact. So as a whole a virtual encapsulation is not violated.
What do you guys think?