Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

IAMA C++ Ask Me Anything

Name: Anonymous 2012-02-18 3:58

Go ahead, I, the mighty, wonderful, beautiful, athletic C++ will answer all your questions!

Name: Anonymous 2012-02-18 16:17

>>10

sometimes you need a function that is used as a method, but the thing acting as the this object is not the first parameter. The << operator used with streams is the basic example, and the only thing I use friend functions for. I'll use friend classes when defining helper data types that make up a private component of a larger data type. There is probably a work around this that would improve reuse, like abstracting the helper types to a more general function, but sometimes achieving that much generality doesn't always pay off.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List