conditional Class
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at 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;
Parameters
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.
Header: <type_traits>
Namespace: std
Show: