Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #10530
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Miles Bader <miles@gnu.org> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: Virtual function call optimization |
| Date | Tue, 27 Sep 2011 13:47:14 +0900 |
| Organization | NEC Electronics |
| Lines | 29 |
| Message-ID | <buod3emiobx.fsf@dhlpc061.dev.necel.com> (permalink) |
| References | <55363b39-cfd1-4ec2-be5a-fa180c64c557@f6g2000vbm.googlegroups.com> <j5nbba$rhs$2@dont-email.me> <82c6cb18-21af-47c3-9d68-60cfc58121b6@k34g2000yqm.googlegroups.com> <j5psg0$pgl$1@dont-email.me> <f22d1a09-5f04-40f5-869e-6c43ab36e7c5@j10g2000vbb.googlegroups.com> <4e80935c$0$31233$a8266bb1@newsreader.readnews.com> <d47cdff0-a16e-4bcc-bb28-476056e6a9a5@e9g2000vby.googlegroups.com> <Xns9F6CCA16CE458myfirstnameosapriee@216.196.109.131> <j5r2lj$9r5$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| X-Trace | individual.net EREWDZV9vZMW1VUP8XAT9gIkfXfkt7Lk4P70pkurT3MotpDS0T |
| Cancel-Lock | sha1:VMJEZ0anmuoOwXySGD/e9hnf3HU= sha1:3U1hOcx0ntpqTTyoH7eQjAd+F3I= |
| System-Type | x86_64-unknown-linux-gnu |
| Blat | Foop |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c++:10530 |
Show key headers only | View raw
Richard Damon <news.x.richarddamon@xoxy.net> writes:
> Another method, if you are willing to upgrade to C++11, and the object
> definition allows it, is to declair foo() to be final, as in
...
> class D: public B
> {
> public:
> void foo() final ( ... }
> }
>
> since D::foo is final, late binding is not needed if the pointer has
> static type D.
Or sometimes more conveniently, declaring the whole class D to be final:
class D final : public B
{
public:
void foo();
};
(which has the advantage that it will make all methods final, even those
D doesn't override)
-miles
--
Accord, n. Harmony.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Virtual function call optimization cppquester <cppquester@googlemail.com> - 2011-09-25 05:42 -0700
Re: Virtual function call optimization Leigh Johnston <leigh@i42.co.uk> - 2011-09-25 14:45 +0100
Re: Virtual function call optimization Victor Bazarov <v.bazarov@comcast.invalid> - 2011-09-25 09:46 -0400
Re: Virtual function call optimization cppquester <cppquester@googlemail.com> - 2011-09-25 20:24 -0700
Re: Virtual function call optimization Victor Bazarov <v.bazarov@comcast.invalid> - 2011-09-26 08:51 -0400
Re: Virtual function call optimization cppquester <cppquester@googlemail.com> - 2011-09-26 07:38 -0700
Re: Virtual function call optimization "Kevin P. Fleming" <news@kpfleming.us> - 2011-09-26 09:59 -0500
Re: Virtual function call optimization cppquester <cppquester@googlemail.com> - 2011-09-26 08:43 -0700
Re: Virtual function call optimization Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-26 11:51 -0500
Re: Virtual function call optimization cppquester <cppquester@googlemail.com> - 2011-09-26 11:25 -0700
Re: Virtual function call optimization Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-26 14:48 -0500
Re: Virtual function call optimization Richard Damon <news.x.richarddamon@xoxy.net> - 2011-09-26 19:42 -0400
Re: Virtual function call optimization Miles Bader <miles@gnu.org> - 2011-09-27 13:47 +0900
Re: Virtual function call optimization Miles Bader <miles@gnu.org> - 2011-09-25 22:58 +0900
csiph-web