[code-quality] fix readability-named-parameter (#7272)

This commit is contained in:
tomaszduda23 2024-08-14 04:21:19 +02:00 committed by GitHub
parent 8756b41b63
commit b2b23f2a4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 18 deletions

View file

@ -82,7 +82,7 @@ template<typename... Ts> class Condition {
} }
protected: protected:
template<int... S> bool check_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { template<int... S> bool check_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
return this->check(std::get<S>(tuple)...); return this->check(std::get<S>(tuple)...);
} }
}; };
@ -156,7 +156,7 @@ template<typename... Ts> class Action {
} }
} }
} }
template<int... S> void play_next_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { template<int... S> void play_next_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
this->play_next_(std::get<S>(tuple)...); this->play_next_(std::get<S>(tuple)...);
} }
void play_next_tuple_(const std::tuple<Ts...> &tuple) { void play_next_tuple_(const std::tuple<Ts...> &tuple) {
@ -223,7 +223,9 @@ template<typename... Ts> class ActionList {
} }
protected: protected:
template<int... S> void play_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { this->play(std::get<S>(tuple)...); } template<int... S> void play_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
this->play(std::get<S>(tuple)...);
}
Action<Ts...> *actions_begin_{nullptr}; Action<Ts...> *actions_begin_{nullptr};
Action<Ts...> *actions_end_{nullptr}; Action<Ts...> *actions_end_{nullptr};

View file

@ -24,7 +24,7 @@ namespace esphome {
struct nullopt_t { // NOLINT struct nullopt_t { // NOLINT
struct init {}; // NOLINT struct init {}; // NOLINT
nullopt_t(init) {} nullopt_t(init /*unused*/) {}
}; };
// extra parenthesis to prevent the most vexing parse: // extra parenthesis to prevent the most vexing parse:
@ -42,13 +42,13 @@ template<typename T> class optional { // NOLINT
optional() {} optional() {}
optional(nullopt_t) {} optional(nullopt_t /*unused*/) {}
optional(T const &arg) : has_value_(true), value_(arg) {} // NOLINT optional(T const &arg) : has_value_(true), value_(arg) {} // NOLINT
template<class U> optional(optional<U> const &other) : has_value_(other.has_value()), value_(other.value()) {} template<class U> optional(optional<U> const &other) : has_value_(other.has_value()), value_(other.value()) {}
optional &operator=(nullopt_t) { optional &operator=(nullopt_t /*unused*/) {
reset(); reset();
return *this; return *this;
} }
@ -130,29 +130,29 @@ template<typename T, typename U> inline bool operator>=(optional<T> const &x, op
// Comparison with nullopt // Comparison with nullopt
template<typename T> inline bool operator==(optional<T> const &x, nullopt_t) { return (!x); } template<typename T> inline bool operator==(optional<T> const &x, nullopt_t /*unused*/) { return (!x); }
template<typename T> inline bool operator==(nullopt_t, optional<T> const &x) { return (!x); } template<typename T> inline bool operator==(nullopt_t /*unused*/, optional<T> const &x) { return (!x); }
template<typename T> inline bool operator!=(optional<T> const &x, nullopt_t) { return bool(x); } template<typename T> inline bool operator!=(optional<T> const &x, nullopt_t /*unused*/) { return bool(x); }
template<typename T> inline bool operator!=(nullopt_t, optional<T> const &x) { return bool(x); } template<typename T> inline bool operator!=(nullopt_t /*unused*/, optional<T> const &x) { return bool(x); }
template<typename T> inline bool operator<(optional<T> const &, nullopt_t) { return false; } template<typename T> inline bool operator<(optional<T> const & /*unused*/, nullopt_t /*unused*/) { return false; }
template<typename T> inline bool operator<(nullopt_t, optional<T> const &x) { return bool(x); } template<typename T> inline bool operator<(nullopt_t /*unused*/, optional<T> const &x) { return bool(x); }
template<typename T> inline bool operator<=(optional<T> const &x, nullopt_t) { return (!x); } template<typename T> inline bool operator<=(optional<T> const &x, nullopt_t /*unused*/) { return (!x); }
template<typename T> inline bool operator<=(nullopt_t, optional<T> const &) { return true; } template<typename T> inline bool operator<=(nullopt_t /*unused*/, optional<T> const & /*unused*/) { return true; }
template<typename T> inline bool operator>(optional<T> const &x, nullopt_t) { return bool(x); } template<typename T> inline bool operator>(optional<T> const &x, nullopt_t /*unused*/) { return bool(x); }
template<typename T> inline bool operator>(nullopt_t, optional<T> const &) { return false; } template<typename T> inline bool operator>(nullopt_t /*unused*/, optional<T> const & /*unused*/) { return false; }
template<typename T> inline bool operator>=(optional<T> const &, nullopt_t) { return true; } template<typename T> inline bool operator>=(optional<T> const & /*unused*/, nullopt_t /*unused*/) { return true; }
template<typename T> inline bool operator>=(nullopt_t, optional<T> const &x) { return (!x); } template<typename T> inline bool operator>=(nullopt_t /*unused*/, optional<T> const &x) { return (!x); }
// Comparison with T // Comparison with T