Using custom RemoveReference instead of relying on the standard library

This commit is contained in:
Pavel Kirienko
2014-08-28 16:37:32 +04:00
parent 62db10d9aa
commit acf45e3e6b
2 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -769,7 +769,7 @@ public:
if (src_row_major.size() == MaxSize)
{
#if UAVCAN_CPP_VERSION > UAVCAN_CPP03
typedef typename std::remove_reference<decltype(*src_row_major.begin())>::type RhsValueType;
typedef typename RemoveReference<decltype(*src_row_major.begin())>::Type RhsValueType;
packSquareMatrixImpl<RhsValueType>(src_row_major.begin());
#else
packSquareMatrixImpl<typename R::value_type>(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<decltype(*dst_row_major.begin())>::type RhsValueType;
typedef typename RemoveReference<decltype(*dst_row_major.begin())>::Type RhsValueType;
unpackSquareMatrixImpl<RhsValueType>(dst_row_major.begin());
#else
unpackSquareMatrixImpl<typename R::value_type>(dst_row_major.begin());
@@ -90,6 +90,15 @@ struct UAVCAN_EXPORT Select<false, TrueType, FalseType>
typedef FalseType Result;
};
/**
* Remove reference as in <type_traits>
*/
template <class T> struct RemoveReference { typedef T Type; };
template <class T> struct RemoveReference<T&> { typedef T Type; };
#if UAVCAN_CPP_VERSION > UAVCAN_CPP03
template <class T> struct RemoveReference<T&&> { typedef T Type; };
#endif
/**
* Value types
*/