[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: inline virtual functions ?
From:       Pete Goodliffe <pete.goodliffe () pace ! co ! uk>
Date:       2000-03-02 10:21:07
[Download RAW message or body]

Lubos Lunak wrote:
> To the original question : In case there's a chance the function will be ever
> get inlined and it will make difference if it is or is not inlined, I'd say make
> it inline.

I disagree. Scott Meyers states in Item 33 of Effective C++:

"Initially, don't inline anything, or at least limit your inlining to those
functions that are truly trivial"

Anything with a virtual binding is not trivial even if it's implementation
is something like:

    virtual void getA() const { return a; }

It's not worth it.

Cheers,

Pete

-- 
Pete Goodliffe, Senior Software Engineer
Pace Micro Technology plc                     Tel: +44 (0) 1223 518579
645 Newmarket Road                            Fax: +44 (0) 1223 518526
Cambridge, CB5 8PB, United Kingdom            WWW: http://www.pace.co.uk/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic