[NFC][Py Reformat] Reformat python files in libcxx/libcxxabi
[llvm-project.git] / libcxx / test / std / depr / depr.function.objects / depr.adaptors / depr.member.pointer.adaptors / mem_fun1.pass.cpp
blob5cdb2043f5c50912721a62bec22d95bc0088a868
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 //===----------------------------------------------------------------------===//
9 // <functional>
11 // template<Returnable S, ClassType T, CopyConstructible A>
12 // mem_fun1_t<S,T,A>
13 // mem_fun(S (T::*f)(A));
15 // REQUIRES: c++03 || c++11 || c++14
16 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
18 #include <functional>
19 #include <cassert>
21 #include "test_macros.h"
23 struct A
25 char a1() {return 5;}
26 short a2(int i) {return short(i+1);}
27 int a3() const {return 1;}
28 double a4(unsigned i) const {return i-1;}
31 int main(int, char**)
33 A a;
34 assert(std::mem_fun(&A::a2)(&a, 5) == 6);
36 return 0;