2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-23 15:52:11 +00:00
Files
hana/benchmark/list/foldable/foldr.cpp
2014-07-16 16:26:23 -04:00

26 lines
496 B
C++

<% render(instance) %>
<%= includes(x) %>
#include <boost/hana/foldable/foldable.hpp>
template <typename ...>
struct result { };
struct f {
template <typename X, typename State>
constexpr result<X, State> operator()(X, State) const { return {}; }
};
struct state { };
template <int> struct x { };
int main() {
auto go = boost::hana::foldr(f{}, state{},
<%= list(
(0..x).map { |i| "x<#{i}>" },
(0..x).map { |i| "x<#{i}>{}" }
) %>
);
}