extern(C++, ns)

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 19 18:51:55 PST 2016


On 01/20/2016 03:25 AM, deadalnix wrote:
> On Wednesday, 20 January 2016 at 02:15:27 UTC, Manu wrote:
>> The C++ namespace semantic doesn't have a proper analogy in D, and the
>> D code is already organised into modules anyway making mirroring of
>> the C++ semantic irrelevant.
>> We don't mirror C/C++ semantics in other facets of the bindings, we
>> just make it link. There's no reason to deviate from that pattern
>> here.
>> Nobody seems to want to address the problem points I raise in my last
>> email though. If it was benign, I wouldn't care, but it causes way
>> more harm than good.
>
> What happens when one has conflicting symbols in 2 C++ namespaces ?
>
> D's mapping of C++ namespaces could just mimic how import resolution
> work : allow qualified and unqualified access to the symbol when there
> is no conflict, forces you to use the qualified one when there (or to
> create an alias, or whatever).

That's how it works. However, two namespace declarations with the same 
identifier will conflict, unlike in C++.


More information about the Digitalmars-d mailing list