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