Sprout/sprout/bitset/hash.hpp

47 lines
1.2 KiB
C++
Raw Normal View History

2013-08-08 09:54:33 +00:00
/*=============================================================================
2015-01-10 10:13:57 +00:00
Copyright (c) 2011-2015 Bolero MURAKAMI
2013-08-08 09:54:33 +00:00
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
2012-06-20 16:40:38 +00:00
#ifndef SPROUT_BITSET_HASH_HPP
#define SPROUT_BITSET_HASH_HPP
#include <functional>
2012-06-20 16:40:38 +00:00
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
2012-06-20 16:40:38 +00:00
#include <sprout/bitset/bitset.hpp>
namespace sprout {
// 20.5.3 hash support
//
// hash_value
//
2012-06-20 16:40:38 +00:00
template<std::size_t N>
inline SPROUT_CONSTEXPR std::size_t
hash_value(sprout::bitset<N> const& v) {
return v.to_hash();
}
} // namespace sprout
namespace std {
2013-04-21 04:30:30 +00:00
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wmismatched-tags"
#endif
//
// hash
//
template<std::size_t N>
struct hash<sprout::bitset<N> >
: public sprout::hash<sprout::bitset<N> >
{};
2013-04-21 04:30:30 +00:00
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
} // namespace std
2012-06-20 16:40:38 +00:00
#endif // #ifndef SPROUT_BITSET_HASH_HPP