On Wednesday, 16 March 2016 at 21:49:05 UTC, Steven Schveighoffer wrote:
No, please don't. Assigning a signed value to an unsigned (and vice versa) is very useful, and there is no good reason to break this.

-Steve

I'm not talking about removing it completely. The implicit conversion should only happen when it's safe:

```
int s;
if (s >= 0) // VRP saves the day
{
  uint u = s;
}
```

```
uint u;

if (u > short.max)
  throw new Exception("Argument out of range");
// Or `assert`
short s = u;
```
  • Re: size_t index=-1; Steven Schveighoffer via Digitalmars-d-learn
    • Re: size_t index=-1; Steven Schveighoffer via Digitalmars-d-learn
      • Re: size_t index=-1; Mathias Lang via Digitalmars-d-learn
        • Re: size_t index... tsbockman via Digitalmars-d-learn
          • Re: size_t i... Steven Schveighoffer via Digitalmars-d-learn
            • Re: siz... tsbockman via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn

Reply via email to