Replacing AA's in druntime
Steven Schveighoffer
schveiguy at yahoo.com
Thu Mar 15 03:41:19 PDT 2012
On Thu, 15 Mar 2012 04:52:41 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:
> On 03/15/2012 09:40 AM, Dmitry Olshansky wrote:
>> On 15.03.2012 2:44, Jakob Bornecrantz wrote:
>>> Not true, as Steven said a opaque pImpl implementation would
>>> work, most modern C library design follow this principle with
>>> only using opaque except for pointers. This is because the ABI
>>> will then only require you call a certain set of functions (that
>>> can be extended to) not what that pointers points to, the
>>> details can be completely hidden.
>>>
>>
>> Trouble is when one dynamic lib uses one version of druntime and AA, and
>> your app another one. Guess what happens with this opaque pointer?
>>
>>
>
> AA should probably be a class with virtual methods.
First, that only works if the vtable layout doesn't change (I've had more
trouble with binary compatibility because of this vs. binary compatibility
from different function implementations in C++).
Second, that breaks a *LOT* of code which expects AA's to just be declared
and used.
-Steve
More information about the Digitalmars-d
mailing list