Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
tuple_common.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <tuple>
9#include <utility>
10
11namespace ext {
12
13template < class Tuple, class Callable, std::size_t ... Is >
14static void foreach_fn ( Tuple && t, Callable callback, std::index_sequence < Is ... > ) {
15 ( callback ( std::forward < std::tuple_element_t < Is, std::remove_reference_t < Tuple > > > ( t.template get < Is > ( ) ) ), ... );
16}
17
18template < class Tuple, class Callable >
19void foreach ( Tuple && t, Callable callback ) {
20 return foreach_fn ( std::forward < Tuple > ( t ), callback, std::make_index_sequence < std::tuple_size_v < std::remove_reference_t < Tuple > > > ( ) );
21}
22
23} /* namespace ext */
24
Definition: sigHandler.cpp:20
int callback(struct dl_phdr_info *info, size_t, void *data)
Definition: simpleStacktrace.cpp:25