Programming-Idioms

History of Idiom 28 > diff from v11 to v12

Edit summary for version 12 :

Version 11

Version 12

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of type Item of the objects in items.

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of type Item of the objects in items.

Imports
import std.algorithm.sorting;
Code
sort!("a.p < b.p")(items);