aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-09-22 14:15:35 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-09-22 14:15:35 +0200
commitd8c10028d96d49b2c783fe279daa91402e8a91da (patch)
tree3747fc06a677a6a8cb2d1ba1486a34a0f26bf868 /src/libutil/config.hh
parent8fdb1d057ac72d07b9e8c6e522d4d7f0a8bdf352 (diff)
Make setDefault() typed
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index df5c2226f..736810bf3 100644
--- a/src/libutil/config.hh
+++ b/src/libutil/config.hh
@@ -194,8 +194,6 @@ public:
bool overridden = false;
- void setDefault(const std::string & str);
-
protected:
AbstractSetting(
@@ -253,6 +251,7 @@ public:
bool operator !=(const T & v2) const { return value != v2; }
void operator =(const T & v) { assign(v); }
virtual void assign(const T & v) { value = v; }
+ void setDefault(const T & v) { if (!overridden) value = v; }
void set(const std::string & str, bool append = false) override;