carl  24.04
Computer ARithmetic Library
boost_util.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <boost/version.hpp>
4 
5 #if BOOST_VERSION < 107100
6 
7 #include "hash.h"
8 
9 #include <boost/dynamic_bitset.hpp>
10 
11 namespace std {
12 
13 /// Hash method for boost::dynamic_bitset. Since boost 1.71 this comes with boost.
14 template<typename Block, typename Allocator>
15 struct hash<boost::dynamic_bitset<Block,Allocator>> {
16  std::size_t operator()(const boost::dynamic_bitset<Block,Allocator>& bs) const {
17  std::size_t seed = bs.size();
18  boost::to_block_range(bs, carl::hash_inserter<Block>{ seed });
19  return seed;
20  }
21 };
22 
23 }
24 
25 #endif
Utility functor to hash a sequence of object using an output iterator.
Definition: hash.h:81