StaticIf - needed for standard types

This commit is contained in:
Pavel Kirienko 2014-02-21 15:58:19 +04:00
parent 232b69580f
commit a155e6f859

View File

@ -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;
};
}