Skip to content

Commit

Permalink
Implement user assign operator to avoid implicit
Browse files Browse the repository at this point in the history
Addresses #332

Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Mar 15, 2022
1 parent ba10632 commit ddf028b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/ignition/physics/SpecifyData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ namespace ignition
/// the newly copied MapData.
public: ExpectData(const ExpectData &_other);

/// \brief Assignment operator.
public: ExpectData& operator=(const ExpectData &_other);

/// TODO(anyone) Implement move constructor and assignment operator. Due
/// to the multiple inheritence used to implement SpcifyData, care must be
/// taken when implementing move constructs to avoid calling a move
Expand Down
10 changes: 10 additions & 0 deletions include/ignition/physics/detail/SpecifyData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ namespace ignition
// Do nothing
}

/////////////////////////////////////////////////
template <typename Expected>
ExpectData<Expected>& ExpectData<Expected>::operator=(
const ExpectData<Expected> &_other)
{
// Call base class assignment operator
this->CompositeData::operator=(_other);
return *this;
}

/////////////////////////////////////////////////
template <typename Expected>
template <typename Data>
Expand Down

0 comments on commit ddf028b

Please sign in to comment.