From: Clifford Wolf Date: Sun, 27 Jul 2014 00:11:57 +0000 (+0200) Subject: Added RTLIL::SigSpec move constructor and move assignment operator X-Git-Tag: yosys-0.4~404 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f3dc86ecd00a9ed5f5b7f09e02a6fe584259f79;p=yosys.git Added RTLIL::SigSpec move constructor and move assignment operator --- diff --git a/kernel/rtlil.h b/kernel/rtlil.h index f235b1de5..97d01617a 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -625,6 +625,21 @@ public: SigSpec(std::vector bits); SigSpec(std::set 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 &chunks() const { pack(); return chunks_; } inline const std::vector &bits() const { inline_unpack(); return bits_; }