https://bugs.documentfoundation.org/show_bug.cgi?id=158337

            Bug ID: 158337
           Summary: Use C++20 std::erase instead of std::removed followed
                    by erase
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to