You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [alg.random.shuffle] section, for ranges::shuffle, the standard states that the complexity is exactly(last - first) - 1) swaps. In some other algorithms, the wording of at most for the number of swaps is used.
Should we change the wording for ranges::shuffle to say at most instead of exactly for the number of swaps? It would be nice for a standard library implementation to perform fewer swaps than required where possible and still be conforming. If not, can someone provide clarity on why there must be exactly this number of swaps in all cases?
This came up during discussion in the libc++ implementation of ranges::shufflehere