From f3d774fa485607bfdf14419b111a65f6cd5528a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 10:48:58 +0100 Subject: [PATCH] Math: revert ability to convert Vector<1, T> to T. Doesn't solve problem I hoped it would solve (adding pointer and Vector<1, size_t> still doesn't compile), breaks GCC 4.7 build in some crazy way and makes certain previously-working operations (like operator== on Vector<1, int> and int) ambiguous. Not worth pursuing further, I think. This reverts commit ca0892f0263785456ed4f4f4dd58de0722a5292c. This reverts commit d6d0fd18901c257b2eda9440c66b122ed6f31e69. --- src/Magnum/Math/Test/VectorTest.cpp | 6 +----- src/Magnum/Math/Vector.h | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 903a35245..5ce3e22a1 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -214,11 +214,7 @@ void VectorTest::constructOneComponent() { /* Implicit constructor must work */ constexpr Vector1 vec = 1.0f; - CORRADE_COMPARE(vec, Vector1{1.0f}); - - /* Conversion back must also work */ - Float value = vec; - CORRADE_COMPARE(value, 1.0f); + CORRADE_COMPARE(vec, Vector1(1)); } void VectorTest::constructConversion() { diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 2110cb643..cc10cccc3 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -211,11 +211,6 @@ template class Vector { return Implementation::VectorConverter::to(*this); } - /** @brief Convert single-component vector to scalar value */ - template::type> constexpr /*implicit*/ operator U() const { - return *_data; - } - /** * @brief Raw data * @return One-dimensional array of `size` length.