Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Lensflare It is the Underdark of languages. It devoured countless of unsuspecting adventurers that ventured too deep and never saw the sun again...
-
iiii90852y@Lensflare "a trove of very niche rarely used features which actually make sense at some point"
-
friend classes and functions can access a classes privates... Which leads to a plethora of 8 year old jokes.
-
if you have a set of classes that are operating tightly with each other, are within the same library, and within the same area of function, sometimes the use of friends can improve performance, because you can circumvent calling methods and access attributes directly and stuff like that. It can be quite useful in some very special cases.
Most of the use i got out of it, is when splitting a class into multiple subclasses that went into different files, while still maintaining a policy on what's accessible and what not to the rest of the codebase. -
Datamind522y“Your friends can touch your privates”
“You’ve got a friend in you”
As a grown man I still chuckle every time I use this keyword -
@Datamind If it's inside of you, doesn't that make it a parasite or a germ or a virus? A friend should be outside of your body. :-D
WTH, TIL there's a "friend" keyword in C++
random
til-today i learned