mirror of
https://github.com/esphome/esphome.git
synced 2024-11-09 16:57:47 +01:00
[code-quality] fix readability-named-parameter (#7272)
This commit is contained in:
parent
8756b41b63
commit
b2b23f2a4f
2 changed files with 20 additions and 18 deletions
|
@ -82,7 +82,7 @@ template<typename... Ts> class Condition {
|
|||
}
|
||||
|
||||
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)...);
|
||||
}
|
||||
};
|
||||
|
@ -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)...);
|
||||
}
|
||||
void play_next_tuple_(const std::tuple<Ts...> &tuple) {
|
||||
|
@ -223,7 +223,9 @@ template<typename... Ts> class ActionList {
|
|||
}
|
||||
|
||||
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_end_{nullptr};
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace esphome {
|
|||
|
||||
struct nullopt_t { // NOLINT
|
||||
struct init {}; // NOLINT
|
||||
nullopt_t(init) {}
|
||||
nullopt_t(init /*unused*/) {}
|
||||
};
|
||||
|
||||
// extra parenthesis to prevent the most vexing parse:
|
||||
|
@ -42,13 +42,13 @@ template<typename T> class optional { // NOLINT
|
|||
|
||||
optional() {}
|
||||
|
||||
optional(nullopt_t) {}
|
||||
optional(nullopt_t /*unused*/) {}
|
||||
|
||||
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()) {}
|
||||
|
||||
optional &operator=(nullopt_t) {
|
||||
optional &operator=(nullopt_t /*unused*/) {
|
||||
reset();
|
||||
return *this;
|
||||
}
|
||||
|
@ -130,29 +130,29 @@ template<typename T, typename U> inline bool operator>=(optional<T> const &x, op
|
|||
|
||||
// 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue