const challenge

Janice Caron caron800 at googlemail.com
Sat Feb 2 08:07:35 PST 2008


On 2/2/08, Christopher Wright <dhasenan at gmail.com> wrote:
> Janice Caron wrote:
> > That said, we could always have a concatenation function in phobos:
> >
> >     string s;
> >     char[] t;
> >     char[] u = cat("hello",s,t);
>
> Which is silly, when we have a catenation operator in the language.

Not really. We could have two functions, cat and icat, whereby cat
always returns a mutable, and icat always returns an invariant. The
concatenation operator, by contrast, always returns the same type as
its inputs.



More information about the Digitalmars-d mailing list