// This work derives from Vittorio Romeo's code used for cppcon 2015 licensed under the Academic Free License. // His code is available here: https://github.com/SuperV1234/cppcon2015 #ifndef EC_META_FOR_EACH_HPP #define EC_META_FOR_EACH_HPP #include #include #include "Morph.hpp" namespace EC { namespace Meta { template constexpr void forEachHelper(Function&& function, TTuple tuple, std::index_sequence) { return (void)std::initializer_list{(function(std::get(tuple)), 0)...}; } template constexpr void forEach(Function&& function) { using TTuple = EC::Meta::Morph >; using TTupleSize = std::tuple_size; using IndexSeq = std::make_index_sequence; return forEachHelper(std::forward(function), TTuple{}, IndexSeq{}); } } } #endif