DIP61: redone to do extern(C++,N) syntax

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 29 08:52:44 PDT 2014


On Tue, 29 Apr 2014 11:47:28 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 04/29/2014 02:01 PM, Steven Schveighoffer wrote:
>> That is what the DIP says:
>>
>> "Declarations in the namespace can be accessed without qualification in
>> the enclosing scope if there is no ambiguity. Ambiguity issues can be
>> resolved by adding the namespace qualifier"
>>
>> Which then  proceeds to show that only the namespace qualifier is needed
>> to disambiguate the symbol.
>>
>> -Steve
>
> You seem to be missing the only important statement that the DIP makes  
> about symbol disambiguation, that follows straight after those examples:
>
> "Name lookup rules are the same as for mixin templates."
>
> (Maybe it should say 'named template mixins'.)

I am not familiar with the rules.

Perhaps you can just outline for me:

module bar;

extern(C++, foo) void func();

module prog;

import bar;

void main()
{
    foo.func(); // works?
}

If this works, then we have a problem. If it doesn't work, well, then I  
see nobody using this feature (using C++ namespace for disambiguation, not  
the mangling, which is still useful).

-Steve


More information about the Digitalmars-d mailing list