Fabric: Correct checking for `sealable` flag with move semantic methods

Summary: In methods which implement move semantic we have to check the source object because it's (also) being mutated.

Reviewed By: JoshuaGross

Differential Revision: D14496937

fbshipit-source-id: f3f2299d14e41c8b269f1647336dbd5b45c235f4
This commit is contained in:
Valentin Shergin 2019-03-18 19:16:40 -07:00 коммит произвёл Facebook Github Bot
Родитель 587087c4e7
Коммит ab86085caf
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -30,7 +30,9 @@ Sealable::Sealable() : sealed_(false) {}
Sealable::Sealable(const Sealable &other) : sealed_(false){};
Sealable::Sealable(Sealable &&other) noexcept : sealed_(false){};
Sealable::Sealable(Sealable &&other) noexcept : sealed_(false) {
other.ensureUnsealed();
};
Sealable::~Sealable() noexcept {};
@ -41,6 +43,7 @@ Sealable &Sealable::operator=(const Sealable &other) {
Sealable &Sealable::operator=(Sealable &&other) noexcept {
ensureUnsealed();
other.ensureUnsealed();
return *this;
}