Opened 13 years ago
Closed 12 years ago
#4022 closed Bugs (fixed)
dynamic_bitset compiler issue
| Reported by: | anonymous | Owned by: | Gennaro Prota | 
|---|---|---|---|
| Milestone: | Boost 1.43.0 | Component: | dynamic_bitset | 
| Version: | Boost 1.38.0 | Severity: | Problem | 
| Keywords: | Cc: | 
Description
dynamic_bitset does not compile with int64 on Visual Studio 9. THink culprit is code below
const size_type extra_bits = count_extra_bits();
This should be
const block_width_type extra_bits = count_extra_bits();
Change History (5)
comment:1 by , 13 years ago
| Component: | None → dynamic_bitset | 
|---|---|
| Owner: | set to | 
comment:2 by , 13 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
comment:3 by , 13 years ago
| Resolution: | fixed | 
|---|---|
| Status: | closed → reopened | 
comment:4 by , 13 years ago
comment:5 by , 12 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | reopened → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    

Of course, you have to use an unsigned type. With that the code does compile, although it emits a warning. The warning is harmless in this case, although it would be better to fix it as you suggest.
#include <boost/dynamic_bitset/dynamic_bitset.hpp> int main() { boost::dynamic_bitset<unsigned long long> bitset_type; bitset_type.resize(10, false); }boost/dynamic_bitset/dynamic_bitset.hpp(673) : warning C4244: 'initializing' : conversion from 'unsigned __int64' to 'const boost::dynamic_bitset<Block>::size_type', possible loss of data with [ Block=unsigned __int64 ] boost/dynamic_bitset/dynamic_bitset.hpp(649) : while compiling class template member function 'void boost::dynamic_bitset<Block>::resize(boost::dynamic_bitset<Block>::size_type,bool)' with [ Block=unsigned __int64 ] .\scratch.cpp(4) : see reference to class template instantiation 'boost::dynamic_bitset<Block>' being compiled with [ Block=unsigned __int64 ]