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 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
16 #include <type_traits>
19 #include "test_macros.h"
23 typedef std::minus
<int> F
;
25 #if TEST_STD_VER <= 17
26 static_assert((std::is_same
<int, F::first_argument_type
>::value
), "" );
27 static_assert((std::is_same
<int, F::second_argument_type
>::value
), "" );
28 static_assert((std::is_same
<int, F::result_type
>::value
), "" );
32 typedef std::minus
<> F2
;
35 assert(f2(3.0, 2) == 1);
36 assert(f2(3, 2.5) == 0.5);
38 constexpr int foo
= std::minus
<int> () (3, 2);
39 static_assert ( foo
== 1, "" );
41 constexpr double bar
= std::minus
<> () (3.0, 2);
42 static_assert ( bar
== 1.0, "" );