Sort an array of composite structures: Difference between revisions

Updated D entry
(Updated D code)
(Updated D entry)
Line 481:
{"David", "19"}];
 
pairs.schwartzSort!(p => p.name)(pairs);
writeln(pairs);
}</lang>
{{out}}
Output:
<pre>[Pair("Adam", "2341"), Pair("Bernie", "122"), Pair("David", "19"), Pair("Joe", "5531"), Pair("Walter", "1234")]</pre>