<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 3 January 2016 at 15:34, Rikki Cattermole via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/01/16 6:26 PM, Manu via Digitalmars-d wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On 3 January 2016 at 15:17, Rikki Cattermole via Digitalmars-d<br></span><span class="">
<<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a> <mailto:<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>>> wrote:<br>
<br>
    Ok, so what I gathered from that is that if a D package/module<br>
    matches a C++ one in scope, D will only be checked.<br>
<br>
<br></span><span class="">
No, you name conflict error. But that's not the main problem I'm talking<br>
about, which is that namespace scopes are created and break everything.<br>
<br></span><span class="">
    The obvious answer would be to rename the D side, but that really<br>
    isn't good enough.<br>
<br>
<br></span><span class="">
You don't just go and rename an entire existing project, which is a lib<br>
in this case (so, also rename all the clients...?) because you need to<br>
type extern(C++) somewhere :/<br>
</span></blockquote>
<br>
Hang on I just tried this on Windows:<br>
<br>
module ns.m;<br>
<br>
import x.y;<br>
// import x.y : ns.Y; // doesn't work grr<br>
import x.y : Y;<span class=""><br>
<br>
<br>
module x.y;<br>
<br>
extern(C++, ns) {<br>
        struct Y {<br>
        }<br>
}<br>
<br>
<br></span>
Does this work for you?<br>
</blockquote></div><br></div><div class="gmail_extra">The short answer is, "most of the time".</div><div class="gmail_extra">I've been using recursive modules to place extern(C++) declarations in a sensible scope quite a lot. It breaks sometimes, not sure why... suspect it's related to forward referencing, or multiple/semi-circular imports.</div></div>