Does slicing have an effect?

Dennis dkorpel at gmail.com
Tue May 21 20:31:58 UTC 2019


I was replacing a memcpy with a slice assignment and accidentally 
used == instead of =.
Usually the compiler protects me from mistakes like that:

```
int[4] a;
a == a;
```
Error: a == a has no effect

However, because I was using slices it didn't:
```
int[4] a;
a[] == a[];
```
No errors

Does slicing have an effect I'm not aware of, or is this a bug?


More information about the Digitalmars-d-learn mailing list