From -4898261277073406109
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,d172be9423d7e292
X-Google-Attributes: gidf78e5,public
From: Christopher Eltschka <celtschk@physik.tu-muenchen.de>
Subject: Re: virtual versus dynamic
Date: 1999/02/02
Message-ID: <36B73CB0.7D37DA29@physik.tu-muenchen.de>#1/1
X-Deja-AN: 439843728
X-Nntp-Posting-Host: coulomb.t30.physik.tu-muenchen.de
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <917861033.740809@saturn.riv.be>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany)
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


Chris Minnoy wrote:
> 
> While I was experimenting with Delphi I noticed a rather remarkable feature
> that C++ doesn't support, namely dynamic methods. Dynamic methods are, just
> like virtual methods, late binded. The difference is size and speed.
> In the Delphi helpfile I found:
> 
> A method is made dynamic by including a dynamic directive in its declaration.
> Dynamic methods are semantically identical to virtual methods.

This sentence settles the issue. The standard only tells you
the semantics, not the implementation of virtual functions.
Compilers are allowed to implement virtual functions with
the Delphi dynamic method mechanism as well as with the usual
vtbl mechanism. It is even allowed to decide the used scheme
on a case-by-case analysis, or to make it dependant on compiler
options, pragmas, or even the method name (i.e. a compiler
which used dynamic invocation for all methods starting with
dyn would be conforming - not that I would like it).
Also, the compiler doesn't need to do any of those - it could
do a type id, and use a big switch statement internally.
Or do an if for the most common case, and use a vtbl or
"dtbl" otherwise.

[...]


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




