Added RTLIL::SigSpec move constructor and move assignment operator
authorClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 00:11:57 +0000 (02:11 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 00:11:57 +0000 (02:11 +0200)
kernel/rtlil.h

index f235b1de5f35c478836a525aa06b4c1c8c896570..97d01617ab39d728374cf25a7ab003126981b446 100644 (file)
@@ -625,6 +625,21 @@ public:
        SigSpec(std::vector<RTLIL::SigBit> bits);
        SigSpec(std::set<RTLIL::SigBit> bits);
 
+       SigSpec(RTLIL::SigSpec &&other) {
+               width_ = other.width_;
+               hash_ = other.hash_;
+               chunks_.swap(other.chunks_);
+               bits_.swap(other.bits_);
+       }
+
+       const RTLIL::SigSpec &operator=(RTLIL::SigSpec &&other) {
+               width_ = other.width_;
+               hash_ = other.hash_;
+               chunks_.swap(other.chunks_);
+               bits_.swap(other.bits_);
+               return *this;
+       }
+
        inline const std::vector<RTLIL::SigChunk> &chunks() const { pack(); return chunks_; }
        inline const std::vector<RTLIL::SigBit> &bits() const { inline_unpack(); return bits_; }