Comment #0 by ilyayaroshenko — 2017-08-20T15:46:56Z
Hi,
Could Dlang get something like that please:
__traits(isModule, M) //for module M;
__traits(isMixinScope, S); //for mixin Foo S;
__traits(isCppNamespace, N) //for extern(C++, N){}
For module I found ugly and probably not universal workaround:
enum isModule(alias M) = __traits(compiles, { mixin(`import ` ~ fullyQualifiedName!M ~ `;`); });
Current problem is that I need to distinguish С++ namespaces and D mixin scopes.
(working on automated C++/Cython bindings generator).
Best regards,
Ilya
Comment #1 by pro.mathias.lang — 2020-02-19T04:59:44Z
Is it still needed ? For C++ namespace I would highly recommend to use `extern(C++, "namespace")` which does not introduce a scope.
Comment #2 by robert.schadek — 2024-12-13T18:54:12Z