www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17768] New: Compile time reflection is missing for


          Issue ID: 17768
           Summary: Compile time reflection is missing for
                    module/namespace(c++)/mixin names
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com


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

(working on automated C++/Cython bindings generator).

Best regards,

Aug 20 2017