]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp
Vendor import of libc++ trunk r300422:
[FreeBSD/FreeBSD.git] / test / std / depr / depr.function.objects / depr.adaptors / depr.member.pointer.adaptors / mem_fun.cxx1z.fail.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <functional>
11
12 // template<Returnable S, ClassType T>
13 //   mem_fun_t<S,T>
14 //   mem_fun(S (T::*f)());
15 // Removed in c++1z
16 // UNSUPPORTED: c++98, c++03, c++11, c++14
17
18 #include <functional>
19 #include <cassert>
20
21 #include "test_macros.h"
22
23 struct A
24 {
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;}
29 };
30
31 int main()
32 {
33     A a;
34     assert(std::mem_fun(&A::a1)(&a) == 5);
35 }