summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/config/test/boost_no_cxx98_binders.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/config/test/boost_no_cxx98_binders.ipp')
-rw-r--r--src/boost/libs/config/test/boost_no_cxx98_binders.ipp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/boost/libs/config/test/boost_no_cxx98_binders.ipp b/src/boost/libs/config/test/boost_no_cxx98_binders.ipp
new file mode 100644
index 000000000..c287e35cc
--- /dev/null
+++ b/src/boost/libs/config/test/boost_no_cxx98_binders.ipp
@@ -0,0 +1,30 @@
+// (C) Copyright John Maddock 2017.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/config for most recent version.
+
+// MACRO: BOOST_NO_CXX98_BINDERS
+// TITLE: std::bind1st, prt_fun and mem_fun
+// DESCRIPTION: The std lib has C++98 binders and adaptors.
+
+#include <functional>
+
+namespace boost_no_cxx98_binders{
+
+int f2(int a, int b) { return a + b; }
+
+struct A
+{
+ int f1(int a) { return a; }
+};
+
+
+int test()
+{
+ A a;
+ return std::bind1st(std::ptr_fun(f2), 0)(0) + std::bind1st(std::mem_fun(&A::f1), &a)(0);
+}
+
+}