Some new algorithms should be marked [[nodiscard]]
These algorithms are equality-preserving, and are ultimately read operations. They should be marked as [[nodiscard]] to reflect that their result is always intended to be used.
Consider similar change for lexicographical_compare_three_way.
Proposed change:
Add [[nodiscard]] to the following ranges:: algorithms.
All algorithms in [alg.nonmodifying].
remove (not a read operation, but the result should rarely be discarded)
remove_if (not a read operation, but the result should rarely be discarded)
is_sorted
is_sorted_until
All algorithms in [alg.binarysearch].
is_parititoned
partition_point
includes
is_heap
All algorithms in [alg.min.max].
lexicographical_compare
Possibly also add nodiscard to lexicographical_compare_three_way.
Some new algorithms should be marked [[nodiscard]] These algorithms are equality-preserving, and are ultimately read operations. They should be marked as [[nodiscard]] to reflect that their result is always intended to be used. Consider similar change for lexicographical_compare_three_way.
Proposed change: Add [[nodiscard]] to the following ranges:: algorithms. All algorithms in [alg.nonmodifying]. remove (not a read operation, but the result should rarely be discarded) remove_if (not a read operation, but the result should rarely be discarded) is_sorted is_sorted_until All algorithms in [alg.binarysearch]. is_parititoned partition_point includes is_heap All algorithms in [alg.min.max]. lexicographical_compare Possibly also add nodiscard to lexicographical_compare_three_way.