DMD 1.022 and 2.005 releases

Walter Bright newshound1 at digitalmars.com
Fri Oct 5 14:21:52 PDT 2007


BCS wrote:
> Walter Bright wrote:
>> BCS wrote:
>>
>>> --To what extent does overloading work across C++/D?
>>
>>
>> Don't know what you mean.
>>
> 
> will this work?
> 
> extern(c++)

Use a capital C.

> {
>     int Foo(int i);
>     int Foo(int* ip);
> }
> 
> void bar()
> {
>     int i;
>     Foo(i);
>     Foo(&i);
> }

Yes.


> What about if there is a
> 
> void Foo(int[] ia){...} // non extern(c++)
> 
> Will that overload with the c++ functions?

Yes. Just remember that the selection of function will follow D 
overloading rules, not C++ rules, even if the functions are labeled 
extern(C++).

> Can D define overloaded extern(c++) function for C++ to link with?

Yes.



More information about the Digitalmars-d-announce mailing list