> So I can compare and sort two items..
>
> May I ask how can I sort the whole stuff?

The solution works for any number of items. sort() uses <=> during the
sorting process, so when you define <=> for your data, you can sort
any number of items.