ultimatepp/autotest/RemoveIf/RemoveIf.cpp
cxl 59dbb4c475 .autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@15328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-10-30 10:45:28 +00:00

22 lines
428 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Vector<int> x { 1, 4, 5, 5, 7, 5, 2, 1, 7, 9 };
DUMP(x);
x.RemoveIf([&](int i) { return x[i] == 8; });
DUMP(x);
x.RemoveIf([&](int i) { return x[i] == 9; });
DUMP(x);
x.RemoveIf([&](int i) { return x[i] == 5; });
DUMP(x);
x.RemoveIf([&](int i) { return true; });
DUMP(x);
CheckLogEtalon();
}