mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 15:39:06 +08:00
StaticIf - needed for standard types
This commit is contained in:
parent
232b69580f
commit
a155e6f859
@ -43,4 +43,21 @@ struct EnableIf { };
|
||||
template<typename T>
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user