mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 01:20:34 +08:00
StaticIf - needed for standard types
This commit is contained in:
@@ -43,4 +43,21 @@ struct EnableIf { };
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct EnableIf<true, T> { typedef T Type; };
|
struct EnableIf<true, T> { typedef T Type; };
|
||||||
|
|
||||||
|
|
||||||
|
template <bool COND, typename TrueType, typename FalseType>
|
||||||
|
struct StaticIf;
|
||||||
|
|
||||||
|
template <typename TrueType, typename FalseType>
|
||||||
|
struct StaticIf<true, TrueType, FalseType>
|
||||||
|
{
|
||||||
|
typedef TrueType Result;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename TrueType, typename FalseType>
|
||||||
|
struct StaticIf<false, TrueType, FalseType>
|
||||||
|
{
|
||||||
|
typedef FalseType Result;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user