// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp // http://stackoverflow.com/questions/687490/c0x-how-do-i-expand-a-tuple-into-variadic-template-function-arguments // Merci à Ryan "FullMetal Alchemist" Lahfa // Merci aussi à Freedom de siteduzero.com #include // http://www.cppsamples.com/common-tasks/apply-tuple-to-function.html template auto NzApplyImpl(F&& fn, Tuple&& t, std::index_sequence) { return std::forward(fn)(std::get(std::forward(t))...); } template auto NzApply(F&& fn, Tuple&& t) { std::size_t constexpr tSize = std::tuple_size::type>::value; return NzApplyImpl(std::forward(fn), std::forward(t), std::make_index_sequence()); } // Algorithme venant de CityHash par Google // http://stackoverflow.com/questions/8513911/how-to-create-a-good-hash-combine-with-64-bit-output-inspired-by-boosthash-co template void NzHashCombine(std::size_t& seed, const T& v) { const nzUInt64 kMul = 0x9ddfea08eb382d69ULL; std::hash hasher; nzUInt64 a = (hasher(v) ^ seed) * kMul; a ^= (a >> 47); nzUInt64 b = (seed ^ a) * kMul; b ^= (b >> 47); seed = static_cast(b * kMul); } #include