Bug #1788: Fix rule-of-three violations inside the stable modules.

This fixes deprecated-copy warnings when compiling with GCC>=9
Also protect some additional Base-constructors from getting called by user code code (#1587)
This commit is contained in:
Christoph Hertzberg
2019-12-19 17:30:11 +01:00
parent 6965f6de7f
commit 870e53c0f2
12 changed files with 68 additions and 20 deletions

View File

@@ -198,6 +198,9 @@ class QuaternionBase : public RotationBase<Derived, 3>
#ifdef EIGEN_QUATERNIONBASE_PLUGIN
# include EIGEN_QUATERNIONBASE_PLUGIN
#endif
protected:
EIGEN_DEFAULT_COPY_CONSTRUCTOR(QuaternionBase)
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(QuaternionBase)
};
/***************************************************************************
@@ -304,12 +307,6 @@ public:
m_coeffs = std::move(other.coeffs());
return *this;
}
// And now because we declared a constructor, we don't get an implicit copy constructor. Say we want one.
/** Default copy constructor */
EIGEN_DEVICE_FUNC Quaternion(const Quaternion& other)
: m_coeffs(other.coeffs())
{}
#endif
EIGEN_DEVICE_FUNC static Quaternion UnitRandom();

View File

@@ -138,12 +138,6 @@ public:
/** \returns the inverse translation (opposite) */
Translation inverse() const { return Translation(-m_coeffs); }
Translation& operator=(const Translation& other)
{
m_coeffs = other.m_coeffs;
return *this;
}
static const Translation Identity() { return Translation(VectorType::Zero()); }
/** \returns \c *this with scalar type casted to \a NewScalarType