Description: Now that C++20 is the baseline for LibreOffice code, it is possible to use C++ features that are only available since C++20. In C++20, it is possible to use std::erase to erase all elements inside a container that are equal to a certain "value". Also, it is possible to use std:erase_if to erase all elements inside a container that satisfy the predicate "pred". For more information, see this description: std::erase, std::erase_if (std::vector) https://en.cppreference.com/w/cpp/container/vector/erase2 See this commit as an example: be1093cce53a3c34a67233391922674c7c62f4e3 Finding instances: Using grep it is possible to find some instances. For example: $ git grep std::remove|grep erase This will not give all the instances, as sometime erase can be a few lines before or after std::remove.
Set to NEW as EasyHack
Luv Sharma committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/cfa35c15d422e4b3cc70dda0dea9cad40f01d303 tdf#158337 use std::erase instead of std::removed followed by erase It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
varshneydevansh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2220b3718fd831e78485cba2a272e9af08907ddd tdf#158337 use std::erase instead of std::remove followed by erase It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
AmandaQuaresmaCoutinho committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/450edc617aa28b003f02204a1748986a21da3ddf tdf#158337 Use C++20 std::erase instead of std::remove followed by erase It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Hossein from comment #0) > Using grep it is possible to find some instances. For example: > $ git grep std::remove|grep erase > > This will not give all the instances, as sometime erase can be a few lines > before or after std::remove. Some potential remaining ones can be found with: git grep -5 std::remove | grep --color=always erase