Oh goodie. But it's best to post /pure text/, and to not refer to
storage elsewhere: that Imgur image will probably disappear in a few
weeks or months, while these Usenet postings will continue to be
archived by various services, including by Google Groups. So that end, I
(1) googled "online ocr",
(2) clicked the first result,
(3) uploaded your image,
(4) downloaded the resulting Word file,
(5) copied the relevant text over to Notepad++ and replaced tabs with
spaces, as well as adding blank lines between paragraphs,
resulting in
<quote>
Writing the definition of a member function within the class definition
has three effects:
• The function will be inline; that is, the compiler will try to
generate code for the function at each point of call rather than using
function-call in¬structions to use common code. This can be a
significant performance advantage for functions, such as month(), that
hardly do anything but are used a lot.
• All uses of the class will have to be recompiled whenever we make a
change to the body of an inlined function. If the function body is out
of the class declaration, recompilation of users is needed only when the
class declaration is itself changed. Not recompiling when the body is
changed can be a huge advantage in large programs.
• The class definition gets larger. Consequently, it can be harder to
find the members among the member function definitions.
The obvious rule of thumb is: Don't put member function bodies in the
class declaration unless you know that you need the performance boost
from inlining tiny functions. Large functions, say five or more lines of
code, don't benefit from inlining and make a class declaration harder to
read. We rarely inline a function that consists of more than one or two
expressions
</quote>
Bjarne Stroustrup is over-simplifying a bit here, for the novice audience.
I think that as language creator we can be assured that he knows better
than to assert what the compiler will do with the `inline` hint.
It's worth noting that this page, in particular the part with a
rectangle around it quoted here, is not about header only modules but
about how to structure a class definition so as to make it *clear*.
Even for a class definition in a header for a conventional separately
compiled module, it can make sense to have some short member functions
inline in the class.
For example, a public short function can check preconditions and
postconditions, but delegate the main work to a private virtual function
that can be arbitrarily complex, possibly with some transformation of
the argument(s). The short public wrapper's body is then part of the
class' public interface. And that body is not subject to change unless
the class interface is changed, in which case recompilation is needed
anyway.
Cheers!, & sorry for mailing this by mistake,
- Alf