]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/tagged.hpp
VM: replacing the copy assignment operators of the smart pointers
[factor.git] / vm / tagged.hpp
index c9a77da67640a17199ff42b6deb739dc80445a0b..7d86ba73cca04df2be4c011c962ff5e82fa52807 100644 (file)
@@ -32,18 +32,17 @@ template <typename Type> struct tagged {
   explicit tagged(cell tagged) : value_(tagged) {}
   explicit tagged(Type* untagged) : value_(factor::tag(untagged)) {}
 
-  Type* operator->() const { return untagged(); }
-  cell* operator&() const { return &value_; }
-
-  const tagged<Type>& operator=(const Type* x) {
-    value_ = tag(x);
-    return *this;
+  void set_value(const cell ptr) {
+    value_ = ptr;
   }
-  const tagged<Type>& operator=(const cell& x) {
-    value_ = x;
-    return *this;
+
+  void set_untagged(const Type *untagged) {
+    set_value(tag(untagged));
   }
 
+  Type* operator->() const { return untagged(); }
+  cell* operator&() const { return &value_; }
+
   bool operator==(const tagged<Type>& x) { return value_ == x.value_; }
   bool operator!=(const tagged<Type>& x) { return value_ != x.value_; }