Changeset c87cd93 for doc/generic_types/evaluation/object.hpp
- Timestamp:
- Apr 17, 2017, 3:47:07 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4ae83a4b
- Parents:
- 33e22da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/object.hpp
r33e22da rc87cd93 72 72 boolean() = default; 73 73 boolean(bool x) : x(x) {} 74 boolean(const boolean&) = default; 75 boolean(boolean&&) = default; 74 76 ptr<object> new_inst() const override { return make<boolean>(); } 75 77 ptr<object> new_copy() const override { return make<boolean>(*this); } … … 79 81 } 80 82 object& operator= (const object& that) override { return *this = that.as<boolean>(); } /***/ 83 boolean& operator= (boolean&&) = default; 81 84 ~boolean() override = default; 82 85 … … 92 95 character() = default; 93 96 character(char x) : x(x) {} 97 character(const character&) = default; 98 character(character&&) = default; 94 99 ptr<object> new_inst() const override { return make<character>(); } 95 100 ptr<object> new_copy() const override { return make<character>(*this); } … … 99 104 } 100 105 object& operator= (const object& that) override { return *this = that.as<character>(); } /***/ 106 character& operator= (character&&) = default; 101 107 ~character() override = default; 102 108 … … 115 121 integer() = default; 116 122 integer(int x) : x(x) {} 123 integer(const integer&) = default; 124 integer(integer&&) = default; 117 125 ptr<object> new_inst() const override { return make<integer>(); } 118 126 ptr<object> new_copy() const override { return make<integer>(*this); } … … 122 130 } 123 131 object& operator= (const object& that) override { return *this = that.as<integer>(); } /***/ 132 integer& operator= (integer&&) = default; 124 133 ~integer() override = default; 125 134 … … 136 145 c_string() : s(empty) {} 137 146 c_string(const char* s) : s(s) {} 147 c_string(const c_string&) = default; 148 c_string(c_string&&) = default; 138 149 ptr<object> new_inst() const override { return make<c_string>(); } 139 150 ptr<object> new_copy() const override { return make<c_string>(s); } … … 143 154 } 144 155 object& operator= (const object& that) override { return *this = that.as<c_string>(); } /***/ 156 c_string& operator= (c_string&&) = default; 145 157 ~c_string() override = default; 146 158 … … 154 166 pair() = default; 155 167 pair(ptr<object>&& x, ptr<object>&& y) : x(std::move(x)), y(std::move(y)) {} 168 pair(const pair& that) : x(that.x->new_copy()), y(that.y->new_copy()) {} 169 pair(pair&& that) : x(std::move(that.x)), y(std::move(that.y)) {} 156 170 ptr<object> new_inst() const override { return make<pair>(); } 157 171 ptr<object> new_copy() const override { return make<pair>(x->new_copy(), y->new_copy()); } … … 162 176 } 163 177 object& operator= (const object& that) override { return *this = that.as<pair>(); } /***/ 178 pair& operator= (pair&& that) { 179 x = std::move(that.x); 180 y = std::move(that.y); 181 return *this; 182 } 164 183 ~pair() override = default; 165 184
Note: See TracChangeset
for help on using the changeset viewer.