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