summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp
blob: b408dfb2c2ceea802a717558c56587736d1873c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// type_traits

// conditional

#include <type_traits>

#include "test_macros.h"

int main()
{
    static_assert((std::is_same<std::conditional<true, char, int>::type, char>::value), "");
    static_assert((std::is_same<std::conditional<false, char, int>::type, int>::value), "");
#if TEST_STD_VER > 11
    static_assert((std::is_same<std::conditional_t<true, char, int>, char>::value), "");
    static_assert((std::is_same<std::conditional_t<false, char, int>, int>::value), "");
#endif
}
OpenPOWER on IntegriCloud