28 #ifndef VC_COMMON_IIF_H_ 29 #define VC_COMMON_IIF_H_ 31 #include "../type_traits" 34 namespace Vc_VERSIONED_NAMESPACE
59 template <
typename Mask,
typename T>
60 Vc_ALWAYS_INLINE enable_if<is_simd_mask<Mask>::value && is_simd_vector<T>::value, T>
iif(
61 const Mask &condition,
const T &trueValue,
const T &falseValue)
64 Vc::where(condition) | result = trueValue;
72 template <
typename Mask,
typename T>
73 enable_if<is_simd_mask<Mask>::value && !is_simd_vector<T>::value, T>
iif(
74 const Mask &,
const T &,
const T &) =
delete;
90 template<
typename T> constexpr T
iif (
bool condition,
const T &trueValue,
const T &falseValue)
92 return condition ? trueValue : falseValue;
97 #endif // VC_COMMON_IIF_H_ The main SIMD mask class.
constexpr T iif(bool condition, const T &trueValue, const T &falseValue)
Overload of the above for boolean conditions.
constexpr WhereImpl::WhereMask< M > where(const M &mask)
Conditional assignment.