Skip to content

Commit

Permalink
Removed Unit move semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Mar 31, 2024
1 parent 1e2a0a5 commit 4d2b463
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
24 changes: 0 additions & 24 deletions source/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,12 @@
using namespace Langulus::A;


/// Move unit
/// @param other - the unit to move
Unit::Unit(Unit&& other) noexcept
: Resolvable {Forward<Resolvable>(other)}
, mOwners {::std::move(other.mOwners)} {
// Replace the owner's unit pointer with the new one
TODO();
/*for (auto owner : mOwners)
owner->ReplaceUnit(&other, this);*/
}

/// Default unit selection simply relays to the owner
/// @param verb - the selection verb
void Unit::Select(Flow::Verb& verb) {
for (auto owner : mOwners)
owner->Select(verb);
}

/// Move operator
/// @param other - unit to move
Unit& Unit::operator = (Unit&& other) noexcept {
Resolvable::operator = (Forward<Resolvable>(other));
mOwners = Move(other.mOwners);

// Update all coupled owners
TODO();
/*for (auto owner : mOwners)
owner->ReplaceUnit(&other, this);*/
return *this;
}

/// Check if this unit has a given set of properties
/// @param descriptor - descriptor with required properties
Expand Down
4 changes: 2 additions & 2 deletions source/Unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ namespace Langulus::A
public:
Unit() noexcept : Resolvable {this} {}
Unit(const Unit&) = delete;
Unit(Unit&&) noexcept;
Unit(Unit&&) noexcept = delete;

Unit& operator = (const Unit&) = delete;
Unit& operator = (Unit&&) noexcept;
Unit& operator = (Unit&&) noexcept = delete;

void Select(Flow::Verb&);

Expand Down

0 comments on commit 4d2b463

Please sign in to comment.