From ca0892f0263785456ed4f4f4dd58de0722a5292c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 8 Feb 2016 21:34:41 +0100 Subject: [PATCH] Math: make it possible to convert Vector<1, T> to T. --- src/Magnum/Math/Vector.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index cc10cccc3..2110cb643 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -211,6 +211,11 @@ 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.