V

Size: a a a
V

V
QLineEdit + ui->lineEdit->setValidator(new QIntValidator(0, 1000, parent));QSpinBox и QDoubleSpinBoxNS
V
TextField {
validator: IntValidator {
bottom: 11
top: 31
}
}SpinBox в контролахTK
М
М
М
TK
std::sort(vec.begin(), vec.end());
B
B
V

VR
V
std::vector<std::string> vector = {"hello", "world", "abc", "fdfd"};
// hello world abc fdfd
std::sort(vector.begin() + 1, vector.end() - 1);
// hello abc world fdfd
std::sort(vector.begin(), vector.end());
// abc fdfd hello world
// сортировка по размеру строки через функцию, >
bool compare (const std::string &a, const std::string &b)
{
return a.size() > b.size();
}
...
std::sort(vector.begin(), vector.end(), compare);
// hello world fdfd abc
// сортировка по размеру строки через лямбду, <
std::sort(vector.begin(), vector.end(), [](const std::string &a, const std::string &b) { return a.size() < b.size(); });
// abc fdfd hello worldVR
M
std::vector<std::string> vector = {"hello", "world", "abc", "fdfd"};
// hello world abc fdfd
std::sort(vector.begin() + 1, vector.end() - 1);
// hello abc world fdfd
std::sort(vector.begin(), vector.end());
// abc fdfd hello world
// сортировка по размеру строки через функцию, >
bool compare (const std::string &a, const std::string &b)
{
return a.size() > b.size();
}
...
std::sort(vector.begin(), vector.end(), compare);
// hello world fdfd abc
// сортировка по размеру строки через лямбду, <
std::sort(vector.begin(), vector.end(), [](const std::string &a, const std::string &b) { return a.size() < b.size(); });
// abc fdfd hello worldV
⚜
TK
TK