From 5a020abb5fb802c13c6bfa9c8bae6e1e16d18a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 24 May 2014 17:56:02 +0200 Subject: [PATCH] Added VectorTypeFor and MatrixTypeFor aliases to DimensionTraits. Also a new gem we can use with GCC 4.7. --- src/Magnum/DimensionTraits.h | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/Magnum/DimensionTraits.h b/src/Magnum/DimensionTraits.h index 6c04a9d03..056772133 100644 --- a/src/Magnum/DimensionTraits.h +++ b/src/Magnum/DimensionTraits.h @@ -25,16 +25,20 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Math/Math.h" -#include "Magnum/Types.h" - /** @file - * @brief Class @ref Magnum::DimensionTraits + * @brief Class @ref Magnum::DimensionTraits, alias @ref Magnum::VectorTypeFor, @ref Magnum::MatrixTypeFor */ +#include "Magnum/Math/Math.h" +#include "Magnum/Types.h" + namespace Magnum { -/** @brief Matrix and vector specializations for given dimension count */ +/** +@brief Matrix and vector specializations for given dimension count + +@see @ref VectorTypeFor, @ref MatrixTypeFor +*/ template struct DimensionTraits { DimensionTraits() = delete; @@ -58,10 +62,20 @@ template struct DimensionTraits { }; /** -@todo `using VectorTypeForDimension = typename DimensionTraits::VectorType` - etc. shortcuts when support for GCC 4.6 is dropped (similarly to what C++14 - does with type traits) - */ +@brief Vector type for given dimension count and type + +Convenience alternative to typename %DimensionTraits::%VectorType. +See @ref DimensionTraits::VectorType for more information. +*/ +template using VectorTypeFor = typename DimensionTraits::VectorType; + +/** +@brief Matrix type for given dimension count and type + +Convenience alternative to typename %DimensionTraits::%MatrixType. +See @ref DimensionTraits::MatrixType for more information. +*/ +template using MatrixTypeFor = typename DimensionTraits::MatrixType; #ifndef DOXYGEN_GENERATING_OUTPUT /* One dimension */