mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 11:23:33 +08:00
Using custom RemoveReference instead of relying on the standard library
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user