Skip to content

Commit e7a3991

Browse files
committed
default move constructors
1 parent bc3716c commit e7a3991

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

include/behaviortree_cpp/bt_factory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class Tree
109109
Tree(const Tree&) = delete;
110110
Tree& operator=(const Tree&) = delete;
111111

112-
Tree(Tree&& other);
113-
Tree& operator=(Tree&& other);
112+
Tree(Tree&& other) = default;
113+
Tree& operator=(Tree&& other) = default;
114114

115115
void initialize();
116116

@@ -215,8 +215,8 @@ class BehaviorTreeFactory
215215
BehaviorTreeFactory(const BehaviorTreeFactory& other) = delete;
216216
BehaviorTreeFactory& operator=(const BehaviorTreeFactory& other) = delete;
217217

218-
BehaviorTreeFactory(BehaviorTreeFactory&& other) noexcept;
219-
BehaviorTreeFactory& operator=(BehaviorTreeFactory&& other) noexcept;
218+
BehaviorTreeFactory(BehaviorTreeFactory&& other) noexcept = default;
219+
BehaviorTreeFactory& operator=(BehaviorTreeFactory&& other) noexcept = default;
220220

221221
/// Remove a registered ID.
222222
bool unregisterBuilder(const std::string& ID);

src/bt_factory.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ BehaviorTreeFactory::BehaviorTreeFactory() : _p(new PImpl)
107107
_p->scripting_enums = std::make_shared<std::unordered_map<std::string, int>>();
108108
}
109109

110-
BehaviorTreeFactory::BehaviorTreeFactory(BehaviorTreeFactory&& other) noexcept
111-
{
112-
this->_p = std::move(other._p);
113-
}
114-
115-
BehaviorTreeFactory& BehaviorTreeFactory::operator=(BehaviorTreeFactory&& other) noexcept
116-
{
117-
this->_p = std::move(other._p);
118-
return *this;
119-
}
120-
121110
BehaviorTreeFactory::~BehaviorTreeFactory()
122111
{}
123112

@@ -531,22 +520,9 @@ BehaviorTreeFactory::substitutionRules() const
531520
return _p->substitution_rules;
532521
}
533522

534-
Tree& Tree::operator=(Tree&& other)
535-
{
536-
subtrees = std::move(other.subtrees);
537-
manifests = std::move(other.manifests);
538-
wake_up_ = other.wake_up_;
539-
return *this;
540-
}
541-
542523
Tree::Tree()
543524
{}
544525

545-
Tree::Tree(Tree&& other)
546-
{
547-
(*this) = std::move(other);
548-
}
549-
550526
void Tree::initialize()
551527
{
552528
wake_up_ = std::make_shared<WakeUpSignal>();

0 commit comments

Comments
 (0)