From 5e45983953a3aac5b4c7fd429bd972828e3c7860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Fri, 12 Oct 2018 17:09:39 +0200 Subject: [PATCH] Math/Angle: Fix compilation & warning on GCC < 8 --- include/Nazara/Math/Angle.hpp | 6 +++--- include/Nazara/Math/Angle.inl | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/Nazara/Math/Angle.hpp b/include/Nazara/Math/Angle.hpp index d65dc7c4f..64e7ad878 100644 --- a/include/Nazara/Math/Angle.hpp +++ b/include/Nazara/Math/Angle.hpp @@ -26,7 +26,7 @@ namespace Nz { public: Angle() = default; - Angle(T value); + Angle(T angle); template explicit Angle(const Angle& Angle); Angle(const Angle&) = default; ~Angle() = default; @@ -51,8 +51,8 @@ namespace Nz Angle ToRadianAngle() const; String ToString() const; - template> operator Angle(); - template> operator Angle(); + template> operator Angle() const { return ToDegreeAngle(); } // GCC < 8 bug + template> operator Angle() const { return ToRadianAngle(); } // GCC < 8 bug Angle& operator=(const Angle&) = default; diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index d50bcb6d1..036ed5943 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -150,8 +150,8 @@ namespace Nz * \param value value of the angle */ template - Angle::Angle(T value) : - value(value) + Angle::Angle(T angle) : + value(angle) { } @@ -345,23 +345,23 @@ namespace Nz * \brief Returns the degree angle that is equivalent to this one * \return Equivalent degree angle */ - template + /*template template - Angle::operator Angle() + Angle::operator Angle() const { return ToDegreeAngle(); - } + }*/ /*! * \brief Converts the angle to a string representation * \return String representation of the angle */ - template + /*template template - Angle::operator Angle() + Angle::operator Angle() const { return ToRadianAngle(); - } + }*/ /*! * \brief Addition operator