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

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 27 23:47:09 PDT 2014


On 4/27/2014 11:30 PM, "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Monday, 28 April 2014 at 06:18:01 UTC, Walter Bright wrote:
>> What I mean is I need a specific code example of what you're talking about, as
>> I cannot deduce it from your statement.
>
> I assume that the type is structural for the extern so that won't be a problem,

I have no idea what a type being "structural for the extern" means.

> but if std:: is extern in library1 and library2 and I also later need a D
> identifier std.something, will I then have to write:
>
> library1.cppbinding.std.something
> library2.std.something
>
> instead of std::something?

1. in D you will never write std::something

2. D can access a function foo without qualification in multiple imports, as 
long as the overloads do not intersect

3. Otherwise, you'll need to qualify to say which one you meant

4. DIP61 does not change name lookup rules

5. If you have an M::foo defined in one C++ library, and M::foo defined in 
another C++ library, then your program will fail to link, whether you call those 
libraries from D or C++ code. D does not fix C++'s One Definition Rule.


More information about the Digitalmars-d mailing list