Logo

Programming-Idioms

History of Idiom 28 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-08-20, 10:21:53

Version 12

2015-08-20, 16:31:32

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);