Proposal: overload conflict resolution

Kristian Kilpi kjkilpi at gmail.com
Sun Dec 10 08:46:10 PST 2006


On Sun, 10 Dec 2006 16:36:51 +0200, Chris Miller <chris at dprogramming.com>  
wrote:
> Given the following function prototypes:
>     void foo(char[] s);
>     void foo(wchar[] s);
>     void foo(dchar[] s);
>
> Currently, if you try to do foo("hello"), the compiler will complain  
> because string literals simulteneous match all the above types.
>
> Proposal:
>     void foo(default char[] s);
>     void foo(wchar[] s);
>     void foo(dchar[] s);
>
[snip]


I have hoped that something like this would be possible in C++, and now,  
in D. Gets my vote!



More information about the Digitalmars-d mailing list