• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (C) 2019 James E. King III
3 //
4 // Permission to copy, use, modify, sell and distribute this software
5 // is granted provided this copyright notice appears in all copies.
6 // This software is provided "as is" without express or implied
7 // warranty, and with no claim as to its suitability for any purpose.
8 //
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
12 //
13 
14 #include <boost/config.hpp>
15 #include <boost/dynamic_bitset.hpp>
16 #include <boost/detail/lightweight_test.hpp>
17 
18 #include <functional>
19 #include <unordered_set>
20 
main(int,char * [])21 int main(int, char*[])
22 {
23     typedef boost::dynamic_bitset<unsigned long> bitset_type;
24     const std::string long_string =
25         "01001110101110110101011010000000000011110101101111111111";
26 
27     bitset_type zeroes(long_string.size(), 0);
28     bitset_type stuff (long_string);
29     bitset_type ones  (long_string.size(), 1);
30 
31     std::unordered_set<bitset_type> bitsets;
32     bitsets.insert(zeroes);
33     bitsets.insert(stuff);
34     bitsets.insert(ones);
35 
36     BOOST_TEST_EQ(bitsets.size(), 3);
37 
38     return boost::report_errors();
39 }
40