Mail Archives: djgpp/1997/10/05/18:19:18
Kurt Wall wrote:
> >If I have a header file like:
> >
> >class foo
> >{
> >public:
> > void fred()
> > {
> > for (int i = 1; i < 1000; i++)
> > bill(i);
> > }
> > void bill() {}
> >};
> Tsk, tsk. Putting code in a header file...
In C++ this is a common practice, because it is one way of getting
member functions to be inlined. (This particular examine is bad, since
foo::fred contains a loop and thus would not be suitable for inlining in
the first place; but foo:bill would be.)
I prefer to spearate inline member function off in an .icc file, but
defining them in the class declaration itself is perfectly legal draft
standard C++.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm://+37.20.07/-121.53.38
\
"After each war there is a little / less democracy to save."
/ Brooks Atkinson
- Raw text -