1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
12 // template<class B> struct negation; // C++17
14 // constexpr bool negation_v = negation<B>::value; // C++17
16 #include <type_traits>
19 #include "test_macros.h"
21 struct True
{ static constexpr bool value
= true; };
22 struct False
{ static constexpr bool value
= false; };
26 static_assert (!std::negation
<std::true_type
>::value
, "" );
27 static_assert ( std::negation
<std::false_type
>::value
, "" );
29 static_assert (!std::negation_v
<std::true_type
>, "" );
30 static_assert ( std::negation_v
<std::false_type
>, "" );
32 static_assert (!std::negation
<True
>::value
, "" );
33 static_assert ( std::negation
<False
>::value
, "" );
35 static_assert (!std::negation_v
<True
>, "" );
36 static_assert ( std::negation_v
<False
>, "" );
38 static_assert ( std::negation
<std::negation
<std::true_type
>>::value
, "" );
39 static_assert (!std::negation
<std::negation
<std::false_type
>>::value
, "" );