Use std::erase_if to simplify removal of items

This function makes it simpler to remove items from collections. Update
our code to make it more readable.

Bug: 198472780
Test: presubmit

Change-Id: I3bc81bf729e9b22ced16691272187870783c1728
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index 8cdb706..469c9e6 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -24,6 +24,7 @@
 
 cc_defaults {
     name: "inputflinger_defaults",
+    cpp_std: "c++20",
     cflags: [
         "-Wall",
         "-Wextra",