www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17150] New: Add a trait to detect the linkage attribute of


          Issue ID: 17150
           Summary: Add a trait to detect the linkage attribute of classes
                    and interfaces
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

Currently extern(C++) interfaces and extern(C++) classes can only be
dinstinguished using compile time introspection on the member functions (with
std.traits.functionLinkage that detects the linkage in the function mangle)

However this kind of introspection is heavy and bug prone (the recurring issue
about protection attribute in __trait(getMember/getOverload)

Two examples of where it would be usefull to have __trait(linkage)

- std.traits.BaseClassesTuple: it only works with D classes so we could filter
the call.
- std.experimental.allocators.allocator.dispose: the overload that takes
interfaces should not work for C++ interfaces.

Feb 06 2017