Ignore:
Timestamp:
Apr 17, 2017, 3:47:07 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
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
Message:

Final version of the benchmark code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/object.hpp

    r33e22da rc87cd93  
    7272        boolean() = default;
    7373        boolean(bool x) : x(x) {}
     74        boolean(const boolean&) = default;
     75        boolean(boolean&&) = default;
    7476        ptr<object> new_inst() const override { return make<boolean>(); }
    7577        ptr<object> new_copy() const override { return make<boolean>(*this); }
     
    7981        }
    8082        object& operator= (const object& that) override { return *this = that.as<boolean>(); } /***/
     83        boolean& operator= (boolean&&) = default;
    8184        ~boolean() override = default;
    8285
     
    9295        character() = default;
    9396        character(char x) : x(x) {}
     97        character(const character&) = default;
     98        character(character&&) = default;
    9499        ptr<object> new_inst() const override { return make<character>(); }
    95100        ptr<object> new_copy() const override { return make<character>(*this); }
     
    99104        }
    100105        object& operator= (const object& that) override { return *this = that.as<character>(); } /***/
     106        character& operator= (character&&) = default;
    101107        ~character() override = default;
    102108
     
    115121        integer() = default;
    116122        integer(int x) : x(x) {}
     123        integer(const integer&) = default;
     124        integer(integer&&) = default;
    117125        ptr<object> new_inst() const override { return make<integer>(); }
    118126        ptr<object> new_copy() const override { return make<integer>(*this); }
     
    122130        }
    123131        object& operator= (const object& that) override { return *this = that.as<integer>(); } /***/
     132        integer& operator= (integer&&) = default;
    124133        ~integer() override = default;
    125134
     
    136145        c_string() : s(empty) {}
    137146        c_string(const char* s) : s(s) {}
     147        c_string(const c_string&) = default;
     148        c_string(c_string&&) = default;
    138149        ptr<object> new_inst() const override { return make<c_string>(); }
    139150        ptr<object> new_copy() const override { return make<c_string>(s); }
     
    143154        }
    144155        object& operator= (const object& that) override { return *this = that.as<c_string>(); } /***/
     156        c_string& operator= (c_string&&) = default;
    145157        ~c_string() override = default;
    146158
     
    154166        pair() = default;
    155167        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)) {}
    156170        ptr<object> new_inst() const override { return make<pair>(); }
    157171        ptr<object> new_copy() const override { return make<pair>(x->new_copy(), y->new_copy()); }
     
    162176        }
    163177        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        }
    164183        ~pair() override = default;
    165184
Note: See TracChangeset for help on using the changeset viewer.