Three real nitpicky C++ questions.

Started by
11 comments, last by iMalc 16 years, 9 months ago
I have been programming a long long time and I have yet to create a class that had a friend class. I have never found a reason that it was "needed".

theTroll
Advertisement
All -
Thank you for your help. That was all very insightful.
I did have a few fundamental flaws in my idea of data hiding and encapsulation and that definately helps clarify all questions about those concerns. Thank you again.

Jeremy (grill8)
Quote:Original post by grill8
2) When and where exactly are inlined functions a good idea to use? My take is that if the function is used in many places but in places that do not require optimization or are not called regularly then inlining functions may not be such a good idea due to larger program size, whereas places nestled deep in regularly used loops may justify the inline. Basically I am just trying to figure out when one should consider inlining, and when exactly inlining is a good idea or not.

3) I know that inlining is at the descression of the compiler to acknowledge or not but how many statements approximately is the maximum length of a function to be even considered for inlining.

The best article I know on the subject:
http://www.gotw.ca/gotw/033.htm

This also makes a good point:
http://programminghacks.blogspot.com/2006/11/memory-leaks-in-c-important-rules.html
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

This topic is closed to new replies.

Advertisement