1 /*=============================================================================
2 Copyright (c) 2014 Christoph Weiss
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_HASH_23072014_1017)
8 #define FUSION_HASH_23072014_1017
10 #include <boost/functional/hash.hpp>
11 #include <boost/fusion/algorithm/iteration/fold.hpp>
12 #include <boost/fusion/support/is_sequence.hpp>
13 #include <boost/utility/enable_if.hpp>
15 namespace boost { namespace fusion
19 struct hash_combine_fold
21 typedef std::size_t result_type;
23 inline std::size_t operator()(std::size_t seed, T const& v)
25 boost::hash_combine(seed, v);
30 template <typename Seq>
32 boost::enable_if<traits::is_sequence<Seq>, std::size_t>::type
33 hash_value(Seq const& seq)
35 return fold(seq, 0, hash_combine_fold());
39 using hashing::hash_value;