1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template<Returnable R, class T, CopyConstructible... Args>
13 // unspecified mem_fn(R (T::* pm)(Args...) const);
20 char test0() const {return 'a';}
21 char test1(int) const {return 'b';}
22 char test2(int, double) const {return 'c';}
35 assert(f(cap) == 'a');
45 assert(f(a, 1) == 'b');
47 assert(f(ap, 2) == 'b');
49 assert(f(cap, 2) == 'b');
59 assert(f(a, 1, 2) == 'c');
61 assert(f(ap, 2, 3.5) == 'c');
63 assert(f(cap, 2, 3.5) == 'c');
69 test0(std::mem_fn(&A::test0));
70 test1(std::mem_fn(&A::test1));
71 test2(std::mem_fn(&A::test2));