Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
conditional Class
Collapse the table of content
Expand the table of content

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

Show:
© 2015 Microsoft