Lexicographic comparison of arrays (of chars)

Per Nordlöw per.nordlow at gmail.com
Wed Jan 22 21:01:58 UTC 2020


On Wednesday, 22 January 2020 at 15:11:09 UTC, Jacob Carlborg 
wrote:
> int opCmp()(const scope typeof(this) that) const @nogc
> {
>     auto a = this[];
>     auto b = that[];
>     return a < b ? -1 : (a > b);
> }
>
> --
> /Jacob Carlborg

I see. Good to know. Thanks


More information about the Digitalmars-d-learn mailing list