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 */