Topic: Manipulation of vtbl, ctors, etc
Author: cadi@uni-paderborn.de (Carsten Ditze)
Date: 17 Oct 1994 18:24:43 GMT Raw View
I think, I've got a serious problem writing portable code using C++. So before
I start to implement some critical C++ code, I'd like to know if some features
of current C++ compilers (e.g. SunOS, Gnu) are also subject to the
standardization process.
So here's my problem:
Many compilers allow to access the virtual tables that are constructed when
using virtual methods. For instance __vptr may be used within C++ source
code (in cfront of the SunOS CC 3.0 compiler) to instantiate/modify the code
address of a single virtual method dynamically at runtime (without
introducing a new derived class at the desgin step). This technique is i.e.
a very attractive feature to implement runtime binding of methods in new
object oriented operating systems.
I've already scanned the FAQ, but I found no hint on this topic, so I decided
to post an article to this group. I'm quite interested to know, if these
internally used variables will be supported in a future standard. I could
imagine that compiler writers provide standard classes that allow for
manipulation of internally used virtual tables, ctors and dtors.
Thanks for your reply,
Carsten
PS.: Today I'm really scared to use internals like __vptr because otherwise
a complex project could be for nothing in a few years even though
implementing in a highly portable programming language.
+------------------------------------------------------------------------+
| Carsten Ditze | e-mail: cadi@uni-paderborn.de |
| University of Paderborn | or: cadi@pbinfo.uucp |
| FB 17 (Dept. of Math. & CS) | or: ...!uunet!unido!pbinfo!cadi |
| | voice: +49 +5251 60-2074 |
| 33095 Paderborn, Germany | fax: +49 +5251 60-3427 |
+------------------------------------------------------------------------+