Thoughts on versioning
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Oct 26 02:04:13 UTC 2021
On 10/25/21 9:41 PM, rikki cattermole wrote:
>
> Alternatively:
>
> mixin template StandardAlgorithmComparison() {
> Tuple!(Range1, Range2) mismatch(alias pred = "a == b", Range1,
> Range2)(Range1 r1, Range2 r2)
> if (isInputRange!(Range1) && isInputRange!(Range2))
> {
> for (; !r1.empty && !r2.empty; r1.popFront(), r2.popFront())
> {
> if (!binaryFun!(pred)(r1.front, r2.front)) break;
> }
> return tuple(r1, r2);
> }
> }
>
> In std2.algorithm.comparison:
>
> mixin StandardAlgorithmComparison;
>
> In std.algorithm.comparison:
>
> mixin StandardAlgorithmComparison;
Good stuff. A great plus is that it works within the existing languages.
Other pros and cons?
More information about the Digitalmars-d
mailing list