DIP61: redone to do extern(C++,N) syntax
Simen Kjærås via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 29 04:34:33 PDT 2014
On 2014-04-28 21:06, Walter Bright via Digitalmars-d wrote:
> On 4/28/2014 2:00 PM, Simen Kjærås via Digitalmars-d wrote:
>> I believe Steven expects things to work this way:
>>
>> module bar;
>>
>> extern(C++, foo) void func();
>>
>>
>> module prog;
>>
>> import bar;
>>
>> void main()
>> {
>> foo.func(); // Calls bar.func (or is that bar.foo.func?)
>> }
>
> It would call bar.foo.func(). But your example is different from Steven's.
It is. That was kinda the point. :p
Building on this knowledge:
module foo;
void func();
module bar;
extern(C++, foo) void func();
module prog;
import foo;
import bar;
void main()
{
// Seems like it's ambiguous between foo.func and bar.foo.func.
foo.func();
}
--
Simen
More information about the Digitalmars-d
mailing list