2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-24 16:12:10 +00:00
Files
hana/benchmark/list/iterable/drop_while.cpp
2014-07-12 10:43:11 -04:00

24 lines
635 B
C++

<% render(instance) %>
<%= includes(x) %>
#include <boost/hana/detail/constexpr.hpp>
#include <boost/hana/integral.hpp>
#include <boost/hana/iterable.hpp>
BOOST_HANA_CONSTEXPR_LAMBDA auto is_odd = [](auto x) {
return x % boost::hana::int_<2> != boost::hana::int_<0>;
};
int main() {
auto go = boost::hana::drop_while(is_odd,
<%= list(
(0..x/2).map { |i| "boost::hana::int_<#{2*i+1}>" } +
(0..x/2).map { |i| "boost::hana::int_<#{2*i}>" },
(0..x/2).map { |i| "boost::hana::int_<#{2*i+1}>{}" } +
(0..x/2).map { |i| "boost::hana::int_<#{2*i}>{}" }
) %>
);
}