const challenge
Derek Parnell
derek at psych.ward
Sat Feb 2 04:14:07 PST 2008
On Sat, 2 Feb 2008 11:42:57 +0000, 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;
But that already compiles and runs okay.
> It could well be that we don't need unique, but you are always going
> to get people complaining that they have to do:
>
> string s;
> char[] t;
> char[] u = "hello".dup ~ s.dup ~ t;
No, you don't have to do that.
> or
>
> string s;
> char[] t;
> char[] u = cast(char[])("hello" ~ s ~ cast(invariant(char)[])t);
Now you're just being silly.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
More information about the Digitalmars-d
mailing list