Browse Source

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]
pull/525/head
Vladimír Vondruš 5 years ago
parent
commit
3cf4573c0e
  1. 3
      src/Magnum/Math/BoolVector.h
  2. 3
      src/Magnum/Math/Complex.h
  3. 3
      src/Magnum/Math/Dual.h
  4. 3
      src/Magnum/Math/Quaternion.h
  5. 3
      src/Magnum/Math/Range.h
  6. 3
      src/Magnum/Math/RectangularMatrix.h
  7. 3
      src/Magnum/Math/Unit.h
  8. 3
      src/Magnum/Math/Vector.h

3
src/Magnum/Math/BoolVector.h

@ -123,9 +123,6 @@ template<std::size_t size> class BoolVector {
/** @brief Construct a boolean vector from external representation */
template<class U, class V = decltype(Implementation::BoolVectorConverter<size, U>::from(std::declval<U>()))> constexpr explicit BoolVector(const U& other) noexcept: BoolVector{Implementation::BoolVectorConverter<size, U>::from(other)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ BoolVector(const BoolVector<size>&) noexcept = default;
/** @brief Convert a boolean vector to external representation */
template<class U, class V = decltype(Implementation::BoolVectorConverter<size, U>::to(std::declval<BoolVector<size>>()))> constexpr explicit operator U() const {
return Implementation::BoolVectorConverter<size, U>::to(*this);

3
src/Magnum/Math/Complex.h

@ -176,9 +176,6 @@ template<class T> class Complex {
/** @brief Construct a complex number from external representation */
template<class U, class V = decltype(Implementation::ComplexConverter<T, U>::from(std::declval<U>()))> constexpr explicit Complex(const U& other): Complex{Implementation::ComplexConverter<T, U>::from(other)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ Complex(const Complex<T>&) noexcept = default;
/** @brief Convert a complex number to external representation */
template<class U, class V = decltype(Implementation::ComplexConverter<T, U>::to(std::declval<Complex<T>>()))> constexpr explicit operator U() const {
return Implementation::ComplexConverter<T, U>::to(*this);

3
src/Magnum/Math/Dual.h

@ -111,9 +111,6 @@ template<class T> class Dual {
*/
template<class U> constexpr explicit Dual(const Dual<U>& other) noexcept: _real{T(other._real)}, _dual{T(other._dual)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ Dual(const Dual<T>&) noexcept = default;
/**
* @brief Raw data
* @return One-dimensional array of two elements

3
src/Magnum/Math/Quaternion.h

@ -354,9 +354,6 @@ template<class T> class Quaternion {
/** @brief Construct quaternion from external representation */
template<class U, class V = decltype(Implementation::QuaternionConverter<T, U>::from(std::declval<U>()))> constexpr explicit Quaternion(const U& other): Quaternion{Implementation::QuaternionConverter<T, U>::from(other)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ Quaternion(const Quaternion<T>&) noexcept = default;
/** @brief Convert quaternion to external representation */
template<class U, class V = decltype(Implementation::QuaternionConverter<T, U>::to(std::declval<Quaternion<T>>()))> constexpr explicit operator U() const {
return Implementation::QuaternionConverter<T, U>::to(*this);

3
src/Magnum/Math/Range.h

@ -171,9 +171,6 @@ template<UnsignedInt dimensions, class T> class Range {
/** @brief Construct range from external representation */
template<class U, class V = decltype(Implementation::RangeConverter<dimensions, T, U>::from(std::declval<U>()))> constexpr explicit Range(const U& other): Range{Implementation::RangeConverter<dimensions, T, U>::from(other)} {}
/** @brief Copy constructor */
constexpr /*implicit*/ Range(const Range<dimensions, T>&) noexcept = default;
/** @brief Convert range to external representation */
template<class U, class V = decltype(Implementation::RangeConverter<dimensions, T, U>::to(std::declval<Range<dimensions, T>>()))> constexpr explicit operator U() const {
return Implementation::RangeConverter<dimensions, T, U>::to(*this);

3
src/Magnum/Math/RectangularMatrix.h

@ -211,9 +211,6 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/** @brief Construct a matrix from external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other)) {}
/** @brief Copy constructor */
constexpr /*implicit*/ RectangularMatrix(const RectangularMatrix<cols, rows, T>&) noexcept = default;
/** @brief Convert a matrix to external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(std::declval<RectangularMatrix<cols, rows, T>>()))> constexpr explicit operator U() const {
return Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(*this);

3
src/Magnum/Math/Unit.h

@ -65,9 +65,6 @@ template<template<class> class Derived, class T> class Unit {
/** @brief Construct from another underlying type */
template<class U> constexpr explicit Unit(Unit<Derived, U> value) noexcept: _value(T(value._value)) {}
/** @brief Copy constructor */
constexpr /*implicit*/ Unit(const Unit<Derived, T>& other) noexcept = default;
/** @brief Explicit conversion to underlying type */
constexpr explicit operator T() const { return _value; }

3
src/Magnum/Math/Vector.h

@ -226,9 +226,6 @@ template<std::size_t size, class T> class Vector {
/** @brief Construct a vector from external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> constexpr explicit Vector(const U& other) noexcept: Vector(Implementation::VectorConverter<size, T, U>::from(other)) {}
/** @brief Copy constructor */
constexpr /*implicit*/ Vector(const Vector<size, T>&) noexcept = default;
/** @brief Convert a vector to external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::to(std::declval<Vector<size, T>>()))> constexpr explicit operator U() const {
return Implementation::VectorConverter<size, T, U>::to(*this);

Loading…
Cancel
Save