Focus

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jan 19 17:49:57 PST 2013


On 1/19/13 1:36 PM, Walter Bright wrote:
> On 1/19/2013 5:57 AM, Andrei Alexandrescu wrote:
>> On 1/19/13 8:21 AM, Maxim Fomin wrote:
>>> How much chances does this program have?
>>> ----------mylib.di--------
>>> class A
>>> {
>>> public int i;
>>> }
>>>
>>> void foo(A a);
>>> ---------mylib.d---------
>>> class A
>>> {
>>> public int i;
>>> private int ii;
>>> }
>>
>> Looks like an ODR violation, but oddly there's nothing stopping us
>> from making
>> this work. It's a good idea to pursue.
>
> It can only work if the user is very well aware of how classes are laid
> out, avoids things that depend on the instance size, etc.

Well I'm thinking of scenarios in which the implementation file imports 
and verifies the incomplete declaration file.

Andrei



More information about the Digitalmars-d mailing list