summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/bind/test/global_placeholders.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/boost/libs/bind/test/global_placeholders.cpp
parentInitial commit. (diff)
downloadceph-upstream/18.2.2.tar.xz
ceph-upstream/18.2.2.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/bind/test/global_placeholders.cpp')
-rw-r--r--src/boost/libs/bind/test/global_placeholders.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/boost/libs/bind/test/global_placeholders.cpp b/src/boost/libs/bind/test/global_placeholders.cpp
new file mode 100644
index 000000000..3b26b8619
--- /dev/null
+++ b/src/boost/libs/bind/test/global_placeholders.cpp
@@ -0,0 +1,22 @@
+// Copyright 2017, 2020 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
+// https://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/bind.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+//
+
+int f( int a, int b, int c )
+{
+ return a + 10 * b + 100 * c;
+}
+
+int main()
+{
+ int const i = 1;
+
+ BOOST_TEST_EQ( boost::bind( f, _1, 2, _2 )( i, 3 ), 321 );
+
+ return boost::report_errors();
+}