extern(C++, ns)

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 20 17:34:54 PST 2016


On 1/20/2016 3:53 PM, tsbockman wrote:
> The thought of needing to do that for (potentially) every single symbol being
> imported is depressing. What happened to DRY?

Since it is completely mechanical, it's an ideal candidate for writing a 
metafunction to do it:

    ----module stl------
    private import core.stdcpp.vector;
    private import core.stdcpp.string;
    ...
    extern (C++, std)
    {
        mixin(aliasAllNamespaceMembers());
    }


More information about the Digitalmars-d mailing list