brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 5b3f2fa Raw
43 lines · cpp
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++1410// type_traits11 12// template<class B> struct negation;                        // C++1713// template<class B>14//   constexpr bool negation_v = negation<B>::value;         // C++1715 16#include <type_traits>17#include <cassert>18 19#include "test_macros.h"20 21struct True  { static constexpr bool value = true; };22struct False { static constexpr bool value = false; };23 24int main(int, char**)25{26    static_assert (!std::negation<std::true_type >::value, "" );27    static_assert ( std::negation<std::false_type>::value, "" );28 29    static_assert (!std::negation_v<std::true_type >, "" );30    static_assert ( std::negation_v<std::false_type>, "" );31 32    static_assert (!std::negation<True >::value, "" );33    static_assert ( std::negation<False>::value, "" );34 35    static_assert (!std::negation_v<True >, "" );36    static_assert ( std::negation_v<False>, "" );37 38    static_assert ( std::negation<std::negation<std::true_type >>::value, "" );39    static_assert (!std::negation<std::negation<std::false_type>>::value, "" );40 41  return 0;42}43