When sorting a vector, detect if the passed sort behavior matches an expected function signature, if it does, use direct invoke (many times faster than dynamic binding).