From 0cadaecbd2076864070597a6050475867629592b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Mon, 7 Sep 2020 16:21:43 +0200 Subject: [PATCH] Fix that clang warning --- include/Nazara/Math/Angle.hpp | 6 ++---- include/Nazara/Math/Angle.inl | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/include/Nazara/Math/Angle.hpp b/include/Nazara/Math/Angle.hpp index 64e7ad878..2656477e6 100644 --- a/include/Nazara/Math/Angle.hpp +++ b/include/Nazara/Math/Angle.hpp @@ -27,8 +27,9 @@ namespace Nz public: Angle() = default; Angle(T angle); + Angle(const Angle& angle); + Angle(const Angle& angle); template explicit Angle(const Angle& Angle); - Angle(const Angle&) = default; ~Angle() = default; T GetCos() const; @@ -51,9 +52,6 @@ namespace Nz Angle ToRadianAngle() const; String ToString() const; - template> operator Angle() const { return ToDegreeAngle(); } // GCC < 8 bug - template> operator Angle() const { return ToRadianAngle(); } // GCC < 8 bug - Angle& operator=(const Angle&) = default; Angle operator+(const Angle& other) const; diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index cb3a237c2..93acb14c8 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -155,6 +155,28 @@ namespace Nz { } + /*! + * \brief Constructs an Angle object from a angle in degrees, converting if required + * + * \param value Angle object to copy + */ + template + Angle::Angle(const Angle& angle) : + value(Detail::AngleUtils::FromDegrees(angle.value)) + { + } + + /*! + * \brief Constructs an Angle object from a angle in radians, converting if required + * + * \param value Angle object to copy + */ + template + Angle::Angle(const Angle& angle) : + value(Detail::AngleUtils::FromRadians(angle.value)) + { + } + /*! * \brief Computes the cosine of the angle * \return Cosine of angle