Specifying C++ symbols in C++ namespaces

Daniel Murphy yebbliesnospam at gmail.com
Thu Apr 3 04:19:56 PDT 2014


"Walter Bright"  wrote in message news:lhi1lt$269h$1 at digitalmars.com...

> Here's Andrei's proposal:
>
>      extern (C++) template nspace() {
>          int foo();
>      }

This is really ugly and complicated.

Why not just

pragma(cpp_namespace, "outer")
{
    pragma(cpp_namespace, "inner")
    {
        extern(C++) void func();
    }
}

which is trivial to implement and doesn't require parser or semantic 
changes?

Adding syntax for actual namespaces to D is a different beast and IMO not 
worthwhile. 



More information about the Digitalmars-d mailing list