Add move constructor to Tag class

This commit is contained in:
Tim Wojtulewicz 2025-03-24 16:06:19 -07:00
parent ed47eedd6a
commit 989e4adf90
2 changed files with 12 additions and 0 deletions

View file

@ -37,6 +37,13 @@ Tag::Tag(const Tag& other) {
etype = other.etype;
}
Tag::Tag(Tag&& other) noexcept {
type = other.type;
subtype = other.subtype;
val = std::move(other.val);
etype = std::move(other.etype);
}
Tag::Tag() {
val = nullptr;
etype = nullptr;

View file

@ -100,6 +100,11 @@ public:
*/
Tag(const Tag& other);
/**
* Move constructor.
*/
Tag(Tag&& other) noexcept;
/**
* Destructor.
*/