mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Simplify code with four-legged std::equal
This commit is contained in:
parent
50c91a0bcc
commit
955e1e1e6c
@ -270,14 +270,10 @@ public:
|
|||||||
operator==(const T &aRhs) const {
|
operator==(const T &aRhs) const {
|
||||||
using ValueType = typename T::value_type;
|
using ValueType = typename T::value_type;
|
||||||
auto tLhs = get<T>();
|
auto tLhs = get<T>();
|
||||||
if (tLhs.size() != aRhs.size())
|
return std::equal(std::begin(tLhs), std::end(tLhs), std::begin(aRhs),
|
||||||
return false;
|
std::end(aRhs), [](const auto &lhs, const auto &rhs) {
|
||||||
else {
|
return std::any_cast<const ValueType &>(lhs) == rhs;
|
||||||
return std::equal(std::begin(tLhs), std::end(tLhs), std::begin(aRhs),
|
});
|
||||||
[](const auto &lhs, const auto &rhs) {
|
|
||||||
return std::any_cast<const ValueType &>(lhs) == rhs;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user