26 lines · plain
1.. title:: clang-tidy - hicpp-ignored-remove-result2 3hicpp-ignored-remove-result4===========================5 6Ensure that the result of ``std::remove``, ``std::remove_if`` and ``std::unique``7are not ignored according to8`rule 17.5.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-library>`_.9 10The mutating algorithms ``std::remove``, ``std::remove_if`` and both overloads11of ``std::unique`` operate by swapping or moving elements of the range they are12operating over. On completion, they return an iterator to the last valid13element. In the majority of cases the correct behavior is to use this result as14the first operand in a call to ``std::erase``.15 16This check is a subset of :doc:`bugprone-unused-return-value17<../bugprone/unused-return-value>`18and depending on used options it can be superfluous to enable both checks.19 20Options21-------22 23.. option:: AllowCastToVoid24 25 Controls whether casting return values to ``void`` is permitted. Default: `true`.26