4 ms·
> That type achieves nothing. The idea of taking params that can't be invalid is that validity is enforced by class invariant. > std::sort doesn't return an i
by TheMonarchist 5y ago
> That type achieves nothing.
The idea of taking params that can't be invalid is that validity is enforced by class invariant.
> std::sort doesn't return an instance of Sorted
It can't, because it sorts in place and therefore has no control over the sequence.
Sorted constructor would sort to guarantee success.