Strange implicit conversion integers on concatenation

Adam D. Ruppe destructionator at gmail.com
Mon Nov 5 15:58:40 UTC 2018


On Monday, 5 November 2018 at 15:36:31 UTC, uranuz wrote:
> I believe that following code shouldn't even compile, but it 
> does and gives non-printable symbol appended at the end of 
> string.

Me too, this is a design flaw in the language. Following C's 
example, int and char can convert to/from each other. So string ~ 
int will convert int to char (as in reinterpret cast) and append 
that.

It is just the way it is, alas.


More information about the Digitalmars-d mailing list