[Issue 13183] C++ namespace should not conflict with import root package
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Feb 14 13:49:32 PST 2017
https://issues.dlang.org/show_bug.cgi?id=13183
--- Comment #10 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Timothee Cour from comment #7)
> what do you mean by `The workaround looks good.`?
It's a workable solution.
> It makes it difficult to integrate; that prevents any direct `import foo`
> which could in turn import `std.something` so forces one to do all sorts of
> convolutions
There always is the potential of name collisions when using interfacing with
libraries and things that were not designed to work together. This is a general
problem, and is not specific to C++ compatibility. The import renaming feature
is a reasonable way to deal with it.
I suggest as a matter of good practice to minimize the size and complexity of
modules that have to import both. I've found this to be successful when dealing
with #include <windows.h>, rather than the common practice of #include
<windows.h> in every file.
--
More information about the Digitalmars-d-bugs
mailing list