summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp')
-rw-r--r--src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp b/src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp
new file mode 100644
index 000000000..b6b42a702
--- /dev/null
+++ b/src/boost/libs/hana/benchmark/find_if/compile.mpl.vector.erb.cpp
@@ -0,0 +1,27 @@
+// Copyright Louis Dionne 2013-2017
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
+
+#include <boost/mpl/find_if.hpp>
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/quote.hpp>
+#include <boost/mpl/vector.hpp>
+namespace mpl = boost::mpl;
+
+
+struct is_last {
+ template <typename N>
+ struct apply
+ : mpl::integral_c<bool, N::type::value == <%= input_size %>>
+ { };
+};
+
+using vector = <%= mpl_vector((1..input_size).to_a.map { |n|
+ "mpl::integral_c<int, #{n}>"
+}) %>;
+
+using result = mpl::find_if<vector, is_last>::type;
+
+
+int main() { }