Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace detail {
- template<class F, class... Ts, std::size_t... Is>
- void for_each_in_tuple(const std::tuple<Ts...> & tuple, F func, std::index_sequence<Is...>){
- using expander = int[];
- (void)expander { 0, ((void)func(std::get<Is>(tuple)), 0)... };
- }
- }
- template<class F, class...Ts>
- void for_each_in_tuple(const std::tuple<Ts...> & tuple, F func){
- detail::for_each_in_tuple(tuple, func, std::make_index_sequence<sizeof...(Ts)>());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement