conditional Class

 

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

template <bool B, class T1, class T2>
    struct conditional;

template <bool _Test, class _T1, class _T2>
    using conditional_t = typename conditional<_Test, _T1, _T2>::type;

B

The value that determines the selected type.

T1

The type result when B is true.

T2

The type result when B is false.

The template member typedef conditional<B, T1, T2>::type evaluates to T1 when B evaluates to true, and evaluates to T2 when B evaluates to false.

Requirements

Header: <type_traits>

Namespace: std

Show: