Browse Source

Fix some global preferences has no effect

Tindy X 5 years ago
parent
commit
b21eab7700
1 changed files with 4 additions and 5 deletions
  1. 4 5
      src/misc.h

+ 4 - 5
src/misc.h

@@ -185,7 +185,7 @@ public:
 
     template <typename T> tribool(const T &value) { set(value); }
 
-    tribool(const tribool &value) { *this = value; }
+    tribool(const tribool &value) { _M_VALUE = value._M_VALUE; }
 
     ~tribool() = default;
 
@@ -205,17 +205,16 @@ public:
 
     bool is_undef() const { return _M_VALUE <= 1; }
 
-    template <typename T> tribool define(const T &value)
+    template <typename T> tribool& define(const T &value)
     {
         if(_M_VALUE <= 1)
             *this = value;
         return *this;
     }
 
-    template <typename T> tribool parse(const T &value)
+    template <typename T> tribool& parse(const T &value)
     {
-        define(value);
-        return *this;
+        return define(value);
     }
 
     tribool reverse()