Commit Graph

125 Commits

Author SHA1 Message Date
Miutsuru kariya
ab192ca5f1 Make default constructor non-explicit (#48)
It is better to support copy-initialization with default constructor. cf. LWG Issue 2193. Default constructors for standard library containers are explicit.
2019-06-12 19:45:11 -04:00
James E. King III
26918f80d5 Add support for std::hash and unit tests for hashing 2019-06-07 13:55:57 -04:00
Alexey Stukalov
229bced733 hash_value() for dynamic_bitset (support boost::hash) 2019-06-07 13:55:57 -04:00
Andrey Semashev
83bdf5a335 Reenabled popcnt for MSVC, improved perf by leveraging ILP.
On MSVC and compatible compilers popcnt is now enabled if it is known at
compile time that the target CPU supports popcnt instruction. Unfortunately,
MSVC does not have a predefined macro specifically for popcnt, so we have
to test for AVX instead. __POPCNT__ is still tested in case clang or user
defines it.

For MSVC, the 64-bit popcount is now also implemented on 32-bit targets by
issuing two 32-bit popcnt instructions. For gcc and compatible compilers,
16-bit popcount implementation is provided, which is better than the generic
popcount implementation, but still slower than byte-wise do_count.

The do_count algorithm implementations have been improved by leveraging
instruction level parallelism better, which gives 0 to 27% improvement and
no regressions.

Also made code formatting more consistent and reduced code duplication between
do_count implementations.
2019-04-26 08:55:53 -04:00
James E. King III
91625cece1 Disable hardware supported popcount on MSVC.
- the new implementation failed to check for hardware support
- the behavior was undefined on platforms without SSE4
2019-02-22 08:36:12 -05:00
James E. King III
a580c496fa fix set() ambiguity with range based call and default value 2018-11-03 16:45:29 -04:00
James E. King III
8e265c49f8 cleanup pending and detail headers 2018-10-21 12:44:12 -04:00
Evgeny Shulgin
a449a11a80 Add set/reset/flip functions to change sequences (#27)
* Add set(pos, len) function to change sequences
* Add reset(pos, len) function to clear sequences
* Add flip(pos, len) function to flip sequences
* Add custom range operations
2018-10-12 08:07:01 -04:00
James E. King III
a0735943f2 Merge branch 'master' into develop 2018-10-12 11:47:12 +00:00
Glen Fernandes
8fe1db1b08 Correct e-mail address 2018-09-23 08:55:34 -04:00
Glen Fernandes
d7d6555f85 Correct e-mail address 2018-09-05 08:11:50 -04:00
Evgeny Shulgin
a90fe08934 Add hardware supported popcount 2018-09-01 21:56:57 -04:00
Nick Thompson
4cac68e762 Remove deprecated header. 2018-02-11 15:08:19 -06:00
Marshall Clow
d3eb4faf0c Fix some warnings from gcc - https://github.com/boostorg/dynamic_bitset/issues/19 2018-01-31 11:11:12 -08:00
Daniela Engert
5b39db5ba0 squash compiler warnings due to wrong order of type-cast and integral type promotion
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-25 10:29:34 +02:00
Edward Diener
0ead484c37 Implemented lexigraphic compare when bitsets have different lengths. 2017-05-17 20:59:08 -04:00
Edward Diener
dbfce8e174 Allow different sized bitsets to be compared for <, >, <=, >= 2017-05-15 13:03:15 -04:00
Daniela Engert
572e9d78ff fix wrong parameter type in constructor of dynamic_bitset::reference
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-03-18 13:49:16 +01:00
Seth Heeren
91895380c6 Add optional serialization support
This implemenents non-intrusive serialization support to dynamic_bitset<> based on Boost Serialization

 - it supports archives that require named elements
 - it gets private member access using a nested friend class (to decouple the interface entirely)
 - relies on boost/serialization/vector.hpp for actual implementation
2017-01-09 03:19:57 +01:00
ricky65
340822f979 Add capacity(), reserve(), and shrink_to_fit(). 2015-06-03 22:45:16 -07:00
Marshall Clow
225064d355 Patch by Riccardo Marcangelo: Added a pop_back() member function which decreases the size of the bitset by one 2014-09-15 08:29:05 -07:00
Glen Fernandes
083c5e6214 Use non-deprecated macro for r-value reference support detection 2014-05-19 17:41:50 -07:00
Glen Fernandes
18eb52ecee Add noexcept specifications 2014-05-19 17:39:39 -07:00
Glen Fernandes
a3ea40d932 Support C++11 minimal allocators 2014-05-19 17:38:23 -07:00
Ahmed Charles
dd7cdc794e Merge branch 'master' into develop 2014-05-17 16:32:16 -06:00
Ahmed Charles
10195375ed Fix lacking include in previous pull request. 2014-05-17 16:30:18 -06:00
Boleslaw Ciesielski
ba0ba59f24 Add support to dynamic_bitset for compiling with exceptions disabled by using BOOST_TRY/BOOST_CATCH.
This applies the patch from bug https://svn.boost.org/trac/boost/ticket/9939
2014-05-16 12:05:43 -04:00
Thomas Klausner
bcc384b604 Fix implicit conversion changes signedness problems.
clang-3.5 trunk 201163 and OS X's clang (not sure which version)
report -Wsign-conversion warnings with this header. This patch fixes
them.

https://svn.boost.org/trac/boost/ticket/9725

Signed-off-by: Thomas Klausner <tk@giga.or.at>
2014-05-16 16:38:38 +02:00
Ahmed Charles
f34a8a4b23 Fix broken build due to addressof() not being included on some platforms. 2014-03-04 12:21:31 -08:00
Ahmed Charles
d19aeced56 Add test_set() (#6164). 2014-03-01 18:19:54 -08:00
Ahmed Charles
1b880102fe Add all() (#8445).
Includes test cases.
2014-03-01 18:11:59 -08:00
Ahmed Charles
86b177d3ee Add support for move constructors in C++11 (#6947). 2014-03-01 18:06:19 -08:00
Ahmed Charles
4c6825716f Fix MSVC warnings (#9621). There should be no behavior change. 2014-03-01 17:56:52 -08:00
Ahmed Charles
ac0baa94ee Whitespace changes. 2014-03-01 17:43:44 -08:00
Alexey Stukalov
0a1621f0e7 simplify dynamic_bitset::find_next()
Instead of masking all bits in the current block that were already
visited and then finding the lowest remaining bit, it shifts the current
block directly to the first unvisited bit and identifies the lowest
set bit.
It requires fewer operations that the original implementation and should
be faster.

See https://svn.boost.org/trac/boost/ticket/5159.
2014-03-01 17:26:39 -08:00
Ahmed Charles
cccd1f74dc Fix MSVC warning about mismatched sizes. 2014-02-18 22:04:43 -08:00
Ahmed Charles
71a5cc6eeb Rename variable to make slightly more sense. 2014-02-18 21:49:59 -08:00
Ahmed Charles
c9fa6dbdd1 Fix spelling mistake. 2014-02-18 21:46:27 -08:00
Marshall Clow
d6f1835fbb Applied patch; Refs #5439
[SVN r71505]
2011-04-26 14:41:50 +00:00
Steven Watanabe
59e99b9b45 Use the correct variable type to save the result of count_extra_bits(). Fixes #4022.
[SVN r62898]
2010-06-13 04:36:50 +00:00
Steven Watanabe
f199a7f006 Cast an anonymous enum to bool. Fixes #4025.
[SVN r62897]
2010-06-13 04:23:35 +00:00
Daniel James
5c79c20827 Merge dynamic bitset from release.
I think the recent changes in trunk and release were for the same problem. But
I'm not sure so I've merged them together. Hopefully, the release branch might
fix the Intel C++ errors as well.

------------------------------------------------------------------------
r52960 | dgregor | 2009-05-13 07:11:03 +0100 (Wed, 13 May 2009) | 1 line

Use enum constants rather than local variables for integral constants. Should fix dynamic_bitset failures on GCC 4.3.x
------------------------------------------------------------------------



[SVN r53050]
2009-05-16 14:58:33 +00:00
Hartmut Kaiser
ed32df5ad2 Minor comment edit
[SVN r52881]
2009-05-10 16:59:27 +00:00
Hartmut Kaiser
da0b582703 Fixing the fix by taking into account __GNUC_PATCHLEVEL__ as well
[SVN r52880]
2009-05-10 16:55:07 +00:00
Hartmut Kaiser
622c8d8fd5 Applying patch fixing problem on certain patch levels for gcc.4.3.3/Ubuntu
[SVN r52879]
2009-05-10 16:52:14 +00:00
Gennaro Prota
59825bc8db dynamic_bitset:
* removed use of BOOST_WORKAROUND in #if for gcc bug c++/8419, as recent
      changes to the implementation of BOOST_WORKAROUND broke its usage with
      arguments such as ( (__GNUC__) * 100 * 100 + (__GNUC_MINOR__) * 100 )


[SVN r49586]
2008-11-04 16:52:00 +00:00
Gennaro Prota
c298ba0c5f dynamic_bitset:
always provide a definition for static data members of const integral type

[SVN r49433]
2008-10-22 15:47:27 +00:00
Gennaro Prota
e953b16cee dynamic_bitset:
* removed one of the workarounds for VC++ <= 7.0 (we don't run tests on
      those compilers, anymore, so we don't really know if the library still
      works with them); other such workarounds exist, though: removing them
      involves heavy refactoring and is probably not worth the corresponding
      risk of destabilization; comments have been added about this latter point

    * comment fixes in detail/dynamic_bitset.hpp


[SVN r49345]
2008-10-15 12:33:37 +00:00
Gennaro Prota
180aa15c44 dynamic_bitset: in reference constructor, assert() before it is (eventually) too late!
[SVN r48730]
2008-09-11 09:46:54 +00:00
Gennaro Prota
f6ce97de67 dynamic_bitset: added spaces in the definition of BOOST_dynamic_bitset_is_numeric (detail/dynamic_bitset.hpp), to avoid getting an unintended alternative token "<:" when invoking the macro with argument "::boost::[u]long_long_type"
[SVN r48664]
2008-09-08 10:20:49 +00:00