Stl: P1209R0 erase_if(), erase()

Created on 6 Sep 2019  路  5Comments  路  Source: microsoft/STL

P1209R0 erase_if(), erase()

cxx20 fixed

Most helpful comment

Look at https://github.com/microsoft/STL/blob/957fe99f41748b80c3108447e5dd5ce2be962f4e/stl/inc/experimental/vector#L26-L36 and the other headers in the experimental directory.

Also look at https://github.com/microsoft/STL/blob/957fe99f41748b80c3108447e5dd5ce2be962f4e/stl/inc/yvals_core.h#L1 ; this needs to be mentioned as a feature, with a feature-test macro, and deprecation machinery needs to be added.

Finally, test changes will be necessary: for the feature-test macro, to test the new feature alongside the experimental one, and to silence the deprecation for the existing test.

All 5 comments

I wanna implement it! 馃槅

Cool 馃樃 This one is a fairly straightforward conversion of the experimental functions, but we need to decide whether to:

  • Outright remove the experimental feature (perhaps only in C++20 mode)
  • Deprecate the experimental feature (always with an escape hatch; perhaps only in C++20 mode)
  • Allow both to coexist

As the experimental feature isn鈥檛 problematic, I think that gentle migration may be best: deprecate only in C++20 mode (where the Standard version is available), with an escape hatch macro.

As this will require some test changes, I would prefer for test/CI to be ready (and the contribution guidelines too) before reviewing this PR. Now that we鈥檙e returning from CppCon 2019, this will be our major focus for the next month or two.

@StephanTLavavej Is there an example of a code that I can use as a reference when I'm working on this? :)

Look at https://github.com/microsoft/STL/blob/957fe99f41748b80c3108447e5dd5ce2be962f4e/stl/inc/experimental/vector#L26-L36 and the other headers in the experimental directory.

Also look at https://github.com/microsoft/STL/blob/957fe99f41748b80c3108447e5dd5ce2be962f4e/stl/inc/yvals_core.h#L1 ; this needs to be mentioned as a feature, with a feature-test macro, and deprecation machinery needs to be added.

Finally, test changes will be necessary: for the feature-test macro, to test the new feature alongside the experimental one, and to silence the deprecation for the existing test.

@utilForever This is just a follow up to see if you're still good with implementing this feature? If not, I'd gladly take the torch :)

Was this page helpful?
0 / 5 - 0 ratings