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:
Родитель
587087c4e7
Коммит
ab86085caf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче