MCPcopy Create free account
hub / github.com/boostorg/hana / main

Function main

example/ext/std/integer_sequence/foldable.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14auto add = [](auto a, auto b, auto c) { return a + b + c; };
15
16int main() {
17 std::tuple<int, long, double> tuple{1, 2l, 3.3};
18
19 auto sum = hana::unpack(std::integer_sequence<int, 0, 1, 2>{}, [&](auto ...i) {
20 // the `i`s are `std::integral_constant<int, ...>`s
21 return add(std::get<decltype(i)::value>(tuple)...);
22 });
23
24 BOOST_HANA_RUNTIME_CHECK(sum == 6.3);
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected