@nogc inconsistent for array comparison depending on mutability of elements
Rene Zwanenburg via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Apr 8 03:11:43 PDT 2016
On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote:
> If the comparison with b shouldn't be allowed, I suggest we add
> opEquals to std.range.only. This removes a need to import
> std.algorithm.equal and reduces bracket nesting:
>
> assert(b == only(1, 2));
equal[1] can compare ranges of different types. It's a bit less
clear than the original code though.
b.equal(only(1, 2));
[1] http://dlang.org/phobos/std_algorithm_comparison.html#.equal
More information about the Digitalmars-d-learn
mailing list