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 // template<Returnable S, ClassType T> 12 // mem_fun_t<S,T> 13 // mem_fun(S (T::*f)()); 14 // Removed in c++17 15 // UNSUPPORTED: c++03, c++11, c++14 16 17 #define _LIBCPP_DISABLE_DEPRECATION_WARNINGS 18 19 #include <functional> 20 #include <cassert> 21 22 #include "test_macros.h" 23 24 struct A 25 { a1A26 char a1() {return 5;} a2A27 short a2(int i) {return short(i+1);} a3A28 int a3() const {return 1;} a4A29 double a4(unsigned i) const {return i-1;} 30 }; 31 main(int,char **)32int main(int, char**) 33 { 34 A a; 35 assert(std::mem_fun(&A::a1)(&a) == 5); 36 37 return 0; 38 } 39