On Sat, 11 Sep 2010 13:20:25 -0400, bearophile <bearophileh...@lycos.com> wrote:

Andrei Alexandrescu:
You can't concatenate two integrals.

The compiler has full type information, so what's wrong in concatenating two char or two dchar into a string or dstring?

It's ambiguous also:

string s1 = "abc", s2 = "def";
auto x = s1 ~ s2;

would you expect x to be "abcdef" or ["abc", "def"]?

Essentially, one of the arguments to concatenation must be an array type in order to avoid ambiguity.

Fortunately, you can get the results you wish with the bracket notation:

auto x = [s1, s2];

-Steve

Reply via email to