summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/parameter/test/literate/namespaces3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/parameter/test/literate/namespaces3.cpp')
-rw-r--r--src/boost/libs/parameter/test/literate/namespaces3.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/boost/libs/parameter/test/literate/namespaces3.cpp b/src/boost/libs/parameter/test/literate/namespaces3.cpp
new file mode 100644
index 000000000..6f5260f72
--- /dev/null
+++ b/src/boost/libs/parameter/test/literate/namespaces3.cpp
@@ -0,0 +1,31 @@
+
+#include <boost/parameter.hpp>
+#include <iostream>
+
+namespace lib {
+ namespace keywords {
+
+ BOOST_PARAMETER_NAME(name)
+ BOOST_PARAMETER_NAME(index)
+ }
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), f, keywords::tag, (optional (name,*,"bob")(index,(int),1))
+ )
+ {
+ std::cout << name << ":" << index << std::endl;
+ return index;
+ }
+}
+
+#include <boost/core/lightweight_test.hpp>
+
+using namespace lib::keywords;
+
+int main()
+{
+ int x = lib::f(_name = "bob", _index = 2);
+ BOOST_TEST_EQ(x, 2);
+ return boost::report_errors();
+}
+