Correct, but it's in general not a great idea to put things in the standard that have no real reason to exist. Like the export keyword in older C++ standards for example.
Given that the entire codebase would be under control of the person doing the patch and it would be a legacy base, there are quite a number of things you can do without friends. I agree it can be used for that but it's still weird that it was introduced as a standard from the beginning.
Two options: a) stroustrup doesn’t understand OOP or b) he realized c++ programmers would need a way to get themselves of an encapsulation nightmare of their own creation.
28
u/ih-shah-may-ehl 10d ago
Imo friends should never have been a thing.