Boost logo

Geometry :

Subject: [ggl] inline keyword in class definition
From: Mateusz Loskot (mateusz)
Date: 2009-05-05 16:38:09


Bruno Lalande wrote:
>> 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.
>
> I agree with this completely, the use of inline keyword doesn't
> guarantee at all that the function will be inlined. If it's long, the
> compiler will refuse to inline it.
>
> However, in my experience the inline keyword actually has an effect
> for free functions. Especially on short free functions, it really
> seems to influence the compiler (at least GCC). So I suggest to leave
> them only on free functions.

I guess, free functions defined in headers but not specified as inline
may break One Definition Rule.

> Have just realized I missed a few of your mails those last days due to
> a misuse of my mail interface. Have read them all now.

No worries, no rush :-)

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

Geometry list run by mateusz at loskot.net