Expand Minimize

conditional Class

Selects one of two types, depending on the specified condition.

template<bool B, class Ty1, class Ty2>
    struct conditional;

template<bool _Test,class T1,class T2>
using conditional_t = typename conditional<_Test, T1, T2>::type;

Parameter

Description

B

The value that determines the selected type.

Ty1

The type to evaluate.

Ty2

The type to evaluate.

conditional<B, Ty1, Ty2>::type evaluates to Ty1 when B evaluates to true, and evaluates to Ty2 when B evaluates to false.

Header: <type_traits>

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft