std.algorithm: Fix the hasAssignableElements restriction from HeapSort

This restriction seems unnecessary (as HeapSortImpl uses swap/swapAt,
which does not require assignability), and was getting in the way of
e.g. sorting a range of Refs. The range can satisfy either
hasAssignableElements, or hasSwappableElements
Switch to matchFirst/matchAll for examples
Use documented unittest rather than code dup
std.algorithm: Allow proxySwap-using swap overload to take by ref
std.algorithm: Add test for sorting via proxySwap
Merge pull request #1856 from eco/do-not-use-match-in-docs

Switch to matchAll() and matchFirst() in std.regex doc examples
Merge pull request #1858 from CyberShadow/std-aglorithm-sort-nonassignable

std.algorithm: Remove the hasAssignableElements restriction from HeapSortImpl
Update comments to match new std.regex examples

Example was switched to matchAll and 'g' was removed but the comment got left in. Another comment about match wasn't switched to matchAll.
Merge pull request #1867 from eco/patch-13

[minor] Remove comment about 'g' flag (no longer applies)