Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dynamic_bitset.hh
Go to the documentation of this file.
1 #ifndef VCSN_MISC_DYNAMIC_BITSET_HH
2 # define VCSN_MISC_DYNAMIC_BITSET_HH
3 
4 // http://stackoverflow.com/questions/12314763/
5 # define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
6 
7 # include <boost/dynamic_bitset.hpp>
8 # include <vcsn/misc/hash.hh>
9 
10 namespace std
11 {
12  template <>
13  struct hash<boost::dynamic_bitset<>>
14  {
15  size_t operator()(const boost::dynamic_bitset<>& bitset) const
16  {
17  size_t res = 0;
18  for (auto s : bitset.m_bits)
19  hash_combine(res, s);
20  return res;
21  }
22  };
23 }
24 
25 namespace vcsn
26 {
27  using dynamic_bitset = boost::dynamic_bitset<>;
28 } // namespace vcsn
29 
30 #endif // !VCSN_MISC_DYNAMIC_BITSET_HH
size_t operator()(const boost::dynamic_bitset<> &bitset) const
boost::dynamic_bitset<> dynamic_bitset