mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-27 00:17:22 +02:00
[code-quality] fix readability-named-parameter (#7272)
This commit is contained in:
+15
-15
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user