• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <functional>
10 
11 // unary_negate
12 
13 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14 
15 #include <functional>
16 #include <type_traits>
17 #include <cassert>
18 
19 #include "test_macros.h"
20 
main(int,char **)21 int main(int, char**)
22 {
23     typedef std::unary_negate<std::logical_not<int> > F;
24     const F f = F(std::logical_not<int>());
25     static_assert((std::is_same<F::argument_type, int>::value), "" );
26     static_assert((std::is_same<F::result_type, bool>::value), "" );
27     assert(f(36));
28     assert(!f(0));
29 
30   return 0;
31 }
32