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 // binary_negate 12 13 #include <functional> 14 #include <type_traits> 15 #include <cassert> 16 17 int main() 18 { 19 typedef std::binary_negate<std::logical_and<int> > F; 20 const F f = F(std::logical_and<int>()); 21 static_assert((std::is_same<int, F::first_argument_type>::value), "" ); 22 static_assert((std::is_same<int, F::second_argument_type>::value), "" ); 23 static_assert((std::is_same<bool, F::result_type>::value), "" ); 24 assert(!f(36, 36)); 25 assert( f(36, 0)); 26 assert( f(0, 36)); 27 assert( f(0, 0)); 28 } 29