btw GCDEF you ever heard of a term called "friendship?"
wait lemme google it
Printable View
btw GCDEF you ever heard of a term called "friendship?"
wait lemme google it
Of course not. We're computer nerds. None of us actually has any friends, just public interfaces.
sorry, but i'm not "just looking for a friend."
i just saw the guy is pretty new to C++ and wanted to be his friend because i like helping others.
if i was "just looking for a friend" I'd be hanging out with my peeps at this time.
Not according to Bjarne. ;)
http://www.research.att.com/~bs/bs_faq2.html#friend
Surely just because it's explicit it doesn't mean that it doesn't violate it?
I have some protected interfaces reserved for future children.Quote:
Originally Posted by Lindley
It depends. If you believe that member functions violate encapsulation, then it is reasonable for you to believe that friends violate encapsulation. Otherwise, it is a matter of degree: friends reduce encapsulation.Quote:
Originally Posted by Mybowlcut
My recommended online reading list related to this topic:
How Non-Member Functions Improve Encapsulation - Meyers
Designing Simple Interfaces - Stroustrup
Monoliths "Unstrung" - Sutter
iPirate:
The most fun part of learning to program is figuring stuff out yourself. Try changing things in the program and see how it affects your results. Like try changing the numbers, changing cout << d to cout << a etc. See what happens, and you can probably figure that stuff out yourself.