コード例 #1
0
ファイル: ecs.hpp プロジェクト: Zigkurat/bgame
void for_each(Tuple&& tuple, F&& f)
{
	constexpr std::size_t N =
			std::tuple_size<std::remove_reference_t<Tuple>>::value;
	for_each_impl(std::forward<Tuple>(tuple), std::forward<F>(f),
			std::make_index_sequence<N>
			{ });
}
コード例 #2
0
 void for_each_helper(Func&& f, IndexTuple<Indexes...>, std::tuple<Args...>&& tup)
 {
     for_each_impl(std::forward<Func>(f), std::forward<Args>(std::get<Indexes>(tup))...);
 }
コード例 #3
0
ファイル: trie.hpp プロジェクト: jamella/learning-fuzzing
	/// \brief Applies \p function to all word (not to the prefixes)
	template <typename Fun> void for_each(Fun && function) const {
		std::vector<T> word;
		return for_each_impl(std::forward<Fun>(function), word);
	}
コード例 #4
0
 void for_each_impl(Func&& f, First&& first, Rest&&...rest)
 {
     f(first);
     for_each_impl(std::forward<Func>(f), rest...);
 }