From acf45e3e6bcc2c30947f1b5b142a41ee7bff5381 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Thu, 28 Aug 2014 16:37:32 +0400 Subject: [PATCH] Using custom RemoveReference instead of relying on the standard library --- libuavcan/include/uavcan/marshal/array.hpp | 4 ++-- libuavcan/include/uavcan/util/templates.hpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index b5de6026b7..fd2bb3f106 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -769,7 +769,7 @@ public: if (src_row_major.size() == MaxSize) { #if UAVCAN_CPP_VERSION > UAVCAN_CPP03 - typedef typename std::remove_reference::type RhsValueType; + typedef typename RemoveReference::Type RhsValueType; packSquareMatrixImpl(src_row_major.begin()); #else packSquareMatrixImpl(src_row_major.begin()); @@ -830,7 +830,7 @@ public: if (dst_row_major.size() == MaxSize) { #if UAVCAN_CPP_VERSION > UAVCAN_CPP03 - typedef typename std::remove_reference::type RhsValueType; + typedef typename RemoveReference::Type RhsValueType; unpackSquareMatrixImpl(dst_row_major.begin()); #else unpackSquareMatrixImpl(dst_row_major.begin()); diff --git a/libuavcan/include/uavcan/util/templates.hpp b/libuavcan/include/uavcan/util/templates.hpp index 6388e2ca66..e739873ec7 100644 --- a/libuavcan/include/uavcan/util/templates.hpp +++ b/libuavcan/include/uavcan/util/templates.hpp @@ -90,6 +90,15 @@ struct UAVCAN_EXPORT Select typedef FalseType Result; }; +/** + * Remove reference as in + */ +template struct RemoveReference { typedef T Type; }; +template struct RemoveReference { typedef T Type; }; +#if UAVCAN_CPP_VERSION > UAVCAN_CPP03 +template struct RemoveReference { typedef T Type; }; +#endif + /** * Value types */