PIP_DEBUG, PIVector sort and doc

This commit is contained in:
Andrey
2022-04-13 11:22:27 +03:00
parent 00830958df
commit e4e16764f3
11 changed files with 77 additions and 41 deletions

View File

@@ -2,12 +2,8 @@
#include <algorithm>
int main(int argc, char * argv[]) {
PIVector <PIString> v(5, [](size_t i){return PIString::fromNumber(i*2);});
v.prepend({"1", "02", "3"});
piCout << v;
std::sort(v.begin(), v.end());
piCout << v;
std::sort(v.rbegin(), v.rend());
piCout << v;
PIVector<int> v{5, 7, 4, 2, 8, 6, 1, 9, 0, 3};
v.sort([](const int & a, const int & b){return a > b;});
piCout << v; // 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
return 0;
}