const challenge

Walter Bright newshound1 at digitalmars.com
Sat Feb 2 10:18:06 PST 2008


Janice Caron wrote:
> Still - nobody here was suggesting unique "on a whim". Rather, it was
> to solve a class of problems, the most obvious of which is to allow
> the following to compile:
> 
>     string s;
>     char[] t;
>     char[] u = "hello" ~ s ~ t;

I understand that's a problem. The solution, however, doesn't need 
unique. It can be solved by having the result type of ~ be a polysemous 
type, i.e. its type is based on how it is used.



More information about the Digitalmars-d mailing list