aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
authorGraham Bennett <graham@grahambennett.org>2022-10-22 14:25:35 +0100
committerGraham Bennett <graham@grahambennett.org>2022-10-22 15:16:46 +0100
commit4563e803633d44ec57dfc4515f0c42c8855c018b (patch)
treeb9230e47e2076befd918e733fc2d8dd426f18589 /src/libutil/config.hh
parentc5fd34a14e2a271b66839b35f500caeae3368be2 (diff)
Fix C++20 warnings
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index 79ec0f9cf..7ac43c854 100644
--- a/src/libutil/config.hh
+++ b/src/libutil/config.hh
@@ -250,11 +250,15 @@ public:
operator const T &() const { return value; }
operator T &() { return value; }
const T & get() const { return value; }
- bool operator ==(const T & v2) const { return value == v2; }
- bool operator !=(const T & v2) const { return value != v2; }
- void operator =(const T & v) { assign(v); }
+ template<typename U>
+ bool operator ==(const U & v2) const { return value == v2; }
+ template<typename U>
+ bool operator !=(const U & v2) const { return value != v2; }
+ template<typename U>
+ void operator =(const U & v) { assign(v); }
virtual void assign(const T & v) { value = v; }
- void setDefault(const T & v) { if (!overridden) value = v; }
+ template<typename U>
+ void setDefault(const U & v) { if (!overridden) value = v; }
void set(const std::string & str, bool append = false) override;