Damien Neil writes: : On Wed, Jan 23, 2002 at 06:00:21PM -0500, Melvin Smith wrote: : > >final and private are completely different concepts as I understand : > >them. : > : > I wouldn't say "completely different". They are both used for "enforcement" : > of similar means, but you are correct, they are different. : : I view "final" as being most useful in an optimization sense. A final : method may be safely inlined, and does not require a vtable entry.
That may be a choice that is best left up to the user code, not the class. As a class designer, you really can't know if someone is going to want to derive from your class someday, but as a mere mortal writing a specific application, you can sometimes be pretty sure that you're not interested in dealing with "more derived" data. Plus you know where your tight loops are, and where you're willing to trade off future generality for current performance. Larry