extern(C++, ns)

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 19 00:41:23 PST 2016


On 18/01/2016 12:19 PM, Chris Wright wrote:
> On Sun, 17 Jan 2016 22:55:23 +1100, Daniel Murphy wrote:
>
>> So now we have two public symbols called 'mylib', and because they
>> conflict they can't be used to disambiguate eg 'someotherlib.funca' with
>> 'library.a.funca'.
>
> Users want to disambiguate between a use of C++ namespace members and
> other values from other modules. The natural way to do this is to provide
> a fully qualified D name. For instance, if I wrapped C++ type
> Urho3D::Core::Context in D module urho3d.core, I'd normally refer to it
> as urho3d.core.Context.
>
> That works today. It's got no problems.
>
> However, in your scenario, users don't want to use the D module names to
> disambiguate. They want to use C++ namespaces. Why?
>

IMO the only reason to use C++ namespaces in D is to match mangling of a 
C++ library you want to link to.  If they just changed mangling and 
nothing else, then they would do their job just fine.


More information about the Digitalmars-d mailing list