summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/member.pointer.adaptors
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-05-11 19:42:16 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-05-11 19:42:16 +0000
commit3e519524c118651123eecf60c2bbc5d65ad9bac3 (patch)
treeb2dd4168cfe448920a602cd7d2e40f95da187153 /libcxx/test/utilities/function.objects/member.pointer.adaptors
parent9132c59d43b6c590c9bb33496eebf9f192d6857a (diff)
downloadbcm5719-llvm-3e519524c118651123eecf60c2bbc5d65ad9bac3.tar.gz
bcm5719-llvm-3e519524c118651123eecf60c2bbc5d65ad9bac3.zip
libcxx initial import
llvm-svn: 103490
Diffstat (limited to 'libcxx/test/utilities/function.objects/member.pointer.adaptors')
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp1
-rw-r--r--libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp1
16 files changed, 16 insertions, 0 deletions
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp
new file mode 100644
index 00000000000..b206b0001d2
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<cReturnable S, ClassType T> // const_mem_fun_t<S,T> // mem_fun(S (T::*f)() const); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a3)(&a) == 1); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp
new file mode 100644
index 00000000000..c2d6407cf6a
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T, CopyConstructible A> // const_mem_fun1_t<S,T,A> // mem_fun(S (T::*f)(A) const); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun(&A::a4)(&a, 6) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
new file mode 100644
index 00000000000..933842e2884
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // const_mem_fun1_ref_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_ref_t<double, A, unsigned> F; static_assert((std::is_base_of<std::binary_function<A, unsigned, double>, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(a, 6) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp
new file mode 100644
index 00000000000..8071810984a
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // const_mem_fun1_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun1_t<double, A, unsigned> F; static_assert((std::is_base_of<std::binary_function<const A*, unsigned, double>, F>::value), ""); const F f(&A::a4); const A a = A(); assert(f(&a, 6) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp
new file mode 100644
index 00000000000..d8c3dbb019e
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T> // const_mem_fun_ref_t<S,T> // mem_fun_ref(S (T::*f)() const); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a3)(a) == 1); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
new file mode 100644
index 00000000000..5cba2c9b0fe
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T, CopyConstructible A> // const_mem_fun1_ref_t<S,T,A> // mem_fun_ref(S (T::*f)(A) const); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { const A a = A(); assert(std::mem_fun_ref(&A::a4)(a, 6) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
new file mode 100644
index 00000000000..f28a36af9f1
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // const_mem_fun_ref_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_ref_t<int, A> F; static_assert((std::is_base_of<std::unary_function<A, int>, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(a) == 1); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp
new file mode 100644
index 00000000000..fdcd440c064
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // const_mem_fun_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::const_mem_fun_t<int, A> F; static_assert((std::is_base_of<std::unary_function<const A*, int>, F>::value), ""); const F f(&A::a3); const A a = A(); assert(f(&a) == 1); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp
new file mode 100644
index 00000000000..0ea08e8d84b
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T> // mem_fun_t<S,T> // mem_fun(S (T::*f)()); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a1)(&a) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp
new file mode 100644
index 00000000000..e47fb6cc6ca
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T, CopyConstructible A> // mem_fun1_t<S,T,A> // mem_fun(S (T::*f)(A)); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun(&A::a2)(&a, 5) == 6); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
new file mode 100644
index 00000000000..adc00597cbe
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // mem_fun1_ref_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_ref_t<short, A, int> F; static_assert((std::is_base_of<std::binary_function<A, int, short>, F>::value), ""); const F f(&A::a2); A a; assert(f(a, 5) == 6); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp
new file mode 100644
index 00000000000..ab29d9a67f8
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // mem_fun1_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun1_t<short, A, int> F; static_assert((std::is_base_of<std::binary_function<A*, int, short>, F>::value), ""); const F f(&A::a2); A a; assert(f(&a, 5) == 6); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp
new file mode 100644
index 00000000000..8d79e7ac768
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T> // mem_fun_ref_t<S,T> // mem_fun_ref(S (T::*f)()); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a1)(a) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp
new file mode 100644
index 00000000000..bbc64a14ba7
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // template<Returnable S, ClassType T, CopyConstructible A> // mem_fun1_ref_t<S,T,A> // mem_fun_ref(S (T::*f)(A)); #include <functional> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { A a; assert(std::mem_fun_ref(&A::a2)(a, 5) == 6); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp
new file mode 100644
index 00000000000..9a9e9dd718c
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // mem_fun_ref_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_ref_t<char, A> F; static_assert((std::is_base_of<std::unary_function<A, char>, F>::value), ""); const F f(&A::a1); A a; assert(f(a) == 5); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp
new file mode 100644
index 00000000000..5db73e169dc
--- /dev/null
+++ b/libcxx/test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp
@@ -0,0 +1 @@
+//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // mem_fun_t #include <functional> #include <type_traits> #include <cassert> struct A { char a1() {return 5;} short a2(int i) {return short(i+1);} int a3() const {return 1;} double a4(unsigned i) const {return i-1;} }; int main() { typedef std::mem_fun_t<char, A> F; static_assert((std::is_base_of<std::unary_function<A*, char>, F>::value), ""); const F f(&A::a1); A a; assert(f(&a) == 5); } \ No newline at end of file
OpenPOWER on IntegriCloud