From 3cf4573c0e4a9b45cec4832dd0dace3f442dd6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Nov 2021 12:01:34 +0100 Subject: [PATCH] Math: drop explicitly defaulted copy constructors. These shouldn't be needed (the newer classes such as Half or CubicHermite don't have them and work fine), moreover Clang 12 is now emitting the following warning for them: Definition of implicit copy assignment operator for 'Foo' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy] --- src/Magnum/Math/BoolVector.h | 3 --- src/Magnum/Math/Complex.h | 3 --- src/Magnum/Math/Dual.h | 3 --- src/Magnum/Math/Quaternion.h | 3 --- src/Magnum/Math/Range.h | 3 --- src/Magnum/Math/RectangularMatrix.h | 3 --- src/Magnum/Math/Unit.h | 3 --- src/Magnum/Math/Vector.h | 3 --- 8 files changed, 24 deletions(-) diff --git a/src/Magnum/Math/BoolVector.h b/src/Magnum/Math/BoolVector.h index 5c76076df..1c8ec6de4 100644 --- a/src/Magnum/Math/BoolVector.h +++ b/src/Magnum/Math/BoolVector.h @@ -123,9 +123,6 @@ template class BoolVector { /** @brief Construct a boolean vector from external representation */ template::from(std::declval()))> constexpr explicit BoolVector(const U& other) noexcept: BoolVector{Implementation::BoolVectorConverter::from(other)} {} - /** @brief Copy constructor */ - constexpr /*implicit*/ BoolVector(const BoolVector&) noexcept = default; - /** @brief Convert a boolean vector to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::BoolVectorConverter::to(*this); diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index d5b0b7039..496991544 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -176,9 +176,6 @@ template class Complex { /** @brief Construct a complex number from external representation */ template::from(std::declval()))> constexpr explicit Complex(const U& other): Complex{Implementation::ComplexConverter::from(other)} {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Complex(const Complex&) noexcept = default; - /** @brief Convert a complex number to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::ComplexConverter::to(*this); diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index 89006a5c3..4f81c45ff 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -111,9 +111,6 @@ template class Dual { */ template constexpr explicit Dual(const Dual& other) noexcept: _real{T(other._real)}, _dual{T(other._dual)} {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Dual(const Dual&) noexcept = default; - /** * @brief Raw data * @return One-dimensional array of two elements diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index de92fa39a..f089e0d05 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -354,9 +354,6 @@ template class Quaternion { /** @brief Construct quaternion from external representation */ template::from(std::declval()))> constexpr explicit Quaternion(const U& other): Quaternion{Implementation::QuaternionConverter::from(other)} {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Quaternion(const Quaternion&) noexcept = default; - /** @brief Convert quaternion to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::QuaternionConverter::to(*this); diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 075b736e3..08135bffd 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -171,9 +171,6 @@ template class Range { /** @brief Construct range from external representation */ template::from(std::declval()))> constexpr explicit Range(const U& other): Range{Implementation::RangeConverter::from(other)} {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Range(const Range&) noexcept = default; - /** @brief Convert range to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::RangeConverter::to(*this); diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index a7c56fd0d..942dd8754 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -211,9 +211,6 @@ template class RectangularMatrix { /** @brief Construct a matrix from external representation */ template::from(std::declval()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} - /** @brief Copy constructor */ - constexpr /*implicit*/ RectangularMatrix(const RectangularMatrix&) noexcept = default; - /** @brief Convert a matrix to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::RectangularMatrixConverter::to(*this); diff --git a/src/Magnum/Math/Unit.h b/src/Magnum/Math/Unit.h index 6a8418c87..fbb152f3e 100644 --- a/src/Magnum/Math/Unit.h +++ b/src/Magnum/Math/Unit.h @@ -65,9 +65,6 @@ template class Derived, class T> class Unit { /** @brief Construct from another underlying type */ template constexpr explicit Unit(Unit value) noexcept: _value(T(value._value)) {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Unit(const Unit& other) noexcept = default; - /** @brief Explicit conversion to underlying type */ constexpr explicit operator T() const { return _value; } diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 374e6f492..83aefa147 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -226,9 +226,6 @@ template class Vector { /** @brief Construct a vector from external representation */ template::from(std::declval()))> constexpr explicit Vector(const U& other) noexcept: Vector(Implementation::VectorConverter::from(other)) {} - /** @brief Copy constructor */ - constexpr /*implicit*/ Vector(const Vector&) noexcept = default; - /** @brief Convert a vector to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::VectorConverter::to(*this);