summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp')
-rw-r--r--src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp b/src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp
new file mode 100644
index 000000000..af10d9a8e
--- /dev/null
+++ b/src/boost/libs/metaparse/example/meta_hs/main_in_haskell.cpp
@@ -0,0 +1,20 @@
+// Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
+// Distributed under 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)
+
+#include <example_in_haskell.hpp>
+
+#include <iostream>
+
+int main()
+{
+ using boost::mpl::int_;
+
+ std::cout
+ << "fib 6 = " << fib::apply<int_<6> >::type::value << std::endl
+ << "fact 4 = " << fact::apply<int_<4> >::type::value << std::endl
+ << "times4 3 = " << times4::apply<int_<3> >::type::value << std::endl
+ << "times11 2 = " << times11::apply<int_<2> >::type::value << std::endl;
+}
+