Boost logo

Geometry :

Subject: [ggl] inline keyword in class definition
From: Mateusz Loskot (mateusz)
Date: 2009-05-04 07:30:53

Barend Gehrels wrote:
>> "3 A function defined within a class definition is an inline
>> function."
> Boost often uses inline itself. I have the feeling that not all
> compilers inline what should be inline.

It looks to me this is more historical relict in Boost:

Compilers are free to decide to inline or not, even if developer
uses all available techniques to suggest inlining: inline keyword
used with in-class definition of function, etc.

At level of source code, there is no way to force compiler to inline.
Though, it is possible using compiler specific switches/options to
configure compilation process.

However, it's hard to get clear explanation of the inline keyword
rationale even from Boost developers. This suggests it's still vague.

> So I got into the habit of adding it unless the functions where
> really large.
> If it is really obsolete (should also be checked then in the older
> GCC compilers) it can be removed of course.

Perhaps it's a good idea, after we find confirmation what's the real
and well-tested behaviour of current compilers.

Best regards,

Mateusz Loskot,
Charter Member of OSGeo,

Geometry list run by mateusz at