Specifying C++ symbols in C++ namespaces

"Théo "Théo
Thu Apr 3 13:54:21 PDT 2014


On Thursday, 3 April 2014 at 11:19:53 UTC, Daniel Murphy wrote:
> "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.


IMO I don't think pragmas are meant to this kind of uses, 
extern(C++) already exists and makes more sense.


More information about the Digitalmars-d mailing list