Boost logo

Boost :

Subject: Re: [boost] Is there a special reason to use inline before template functions?
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2008-12-09 14:49:47


Brian Ravnsgaard Riis wrote:
>
> So, there was a good argument after all! :-D I was hoping you would come
> back with something more descriptive than "They don't." I think it was
> the terseness of it I frowned upon.

No problem :)

>
> Of course, after profiling, applying a hint to the compiler about
> inlining may indeed be in order. I still think it is a rare thing that
> you should second-guess your compiler, but I'll admit that it can have
> its uses. Actually, I think I would prefer inlining a specific function
> *call* if that were possible, not the function, but...

I've had to jump through hoops to achieve just that before. Basically I
wrote a function I force to inline and then making a trivial function
which I don't inline which forwards to the first function. Then I use
the first function directly when I want the call inline and the second
function when I don't want the code bloat.

It is an ugly solution but it functioned.

>
> Heading seriously off-topic here... Thanks for your replies, Dave,
> Jonathan and Michael. I got the "discussion" I was hoping for. :-)
>

HTH

-- 
Michael Marcin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk