sequential_erase: amend the predicate passed to erase_if
LWG4135 applies to the quoted Standard paragraph (and therefore to our own code as well). https://cplusplus.github.io/LWG/issue4135 Pick-to: 6.8 Change-Id: I05caa4cba001ecc473412c789738480d8eafa0c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 41ffc92f18a1a492720d432f00761e5574076060) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
e8de198ef7
commit
275a47b92c
@ -372,7 +372,7 @@ template <typename Container, typename T>
|
||||
auto sequential_erase(Container &c, const T &t)
|
||||
{
|
||||
// use the equivalence relation from http://eel.is/c++draft/list.erasure#1
|
||||
auto cmp = [&](auto &e) { return e == t; };
|
||||
auto cmp = [&](const auto &e) -> bool { return e == t; };
|
||||
return sequential_erase_if(c, cmp); // can't pass rvalues!
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user