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 | // REQUIRES: c++03 || c++11 || c++14 |
11 | // unary_function was removed in C++17 |
12 | |
13 | // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS |
14 | |
15 | // template <class Arg, class Result> |
16 | // struct unary_function |
17 | // { |
18 | // typedef Arg argument_type; |
19 | // typedef Result result_type; |
20 | // }; |
21 | |
22 | #include <functional> |
23 | #include <type_traits> |
24 | |
25 | #include "test_macros.h" |
26 | |
27 | int main(int, char**) |
28 | { |
29 | static_assert((std::is_same<std::unary_function<unsigned, char>::argument_type, unsigned>::value), "" ); |
30 | static_assert((std::is_same<std::unary_function<unsigned, char>::result_type, char>::value), "" ); |
31 | |
32 | return 0; |
33 | } |
34 | |