Commit Graph

473 Commits

Author SHA1 Message Date
Gennaro Prota
c13a99640a Try a workaround to have MrDocs document the specialization of std::hash 2025-09-16 10:53:23 +02:00
Gennaro Prota
11088d0d80 Remove extra parentheses in the implementation of operator<()
Reason: Consistency.
2025-09-15 19:23:49 +02:00
Gennaro Prota
fa3cef5485 Add missing spaces in a comment
Reason: Consistency.
2025-09-15 19:23:49 +02:00
Gennaro Prota
4157a327d9 Simplify the implementation of all() 2025-09-15 19:23:49 +02:00
Gennaro Prota
eea6992389 Remove a reference to a removed comment
The referenced comment was removed when porting the documentation to
MrDocs. It advised against using the constructor from basic_string, but,
perhaps, that advice was a bit too strong (constructing from strings is
handy, and probably faster than inputting from a stringstream).
2025-09-15 19:23:49 +02:00
Gennaro Prota
87ea757f7b Add trailing periods to the \pre paragraphs that missed them
Reason: Consistency.
2025-09-15 19:22:48 +02:00
Gennaro Prota
8b729ca3ff Fix a few documentation glitches 2025-09-15 17:18:18 +02:00
Gennaro Prota
a6a7ffa9e6 Make the three "from string" constructors explicit
Making them non-explicit was an oversight.
2025-09-15 12:13:43 +02:00
Gennaro Prota
228d39efd2 Settle the documentation of the iterators
We choose to hide the iterator type definitions and just document their
category, which is enough.
2025-09-15 12:07:27 +02:00
Gennaro Prota
09b7ca2135 Improve the encapsulation of bit_iterator_base 2025-09-12 19:48:15 +02:00
Gennaro Prota
71eaf3136b Fix an error in the documentation of operator==() 2025-09-12 18:33:05 +02:00
Gennaro Prota
ca06119e71 Remove the dependency on core/allocator_access.hpp 2025-09-12 16:34:25 +02:00
Gennaro Prota
fae1e7f97a Make the max_size() tests a bit more meaningful 2025-09-12 11:53:01 +02:00
Gennaro Prota
94eef0dd8d Add a missing comment 2025-09-12 11:41:26 +02:00
Gennaro Prota
f3526cb606 Add push_front() and pop_front() 2025-09-12 11:10:33 +02:00
Gennaro Prota
d79c7f992d No longer use BOOST_NO_CXX11_RVALUE_REFERENCES
Reason: We require decent C++11 support anyway.
2025-09-12 10:42:05 +02:00
Gennaro Prota
ce3435f662 Add two blank lines
Reason: Readability, consistency.
2025-09-12 10:25:30 +02:00
Gennaro Prota
c3a0cc2a32 Make the descriptions of the preconditions of the three "from string" constructors more precise 2025-09-12 10:19:51 +02:00
Gennaro Prota
bd36e481d8 Add a constructor from basic_string_view in C++17 or later
Note that we have MrDocs compile as C++17 again (a change that we had
reverted).
2025-09-12 10:19:51 +02:00
Gennaro Prota
0d0e881254 Add a constructor from const CharT * (pointer to C-style string)
This is in preparation of the next commit, which will add a constructor
from std::basic_string_view (otherwise, construction from a C-style
string would be ambiguous between the basic_string_view and the
basic_string constructor).

Note that, rather than duplicating code to test the new member, we
changed many constructions in dyn_bitset_unit_tests1.cpp to use const
char *, instead of std::string. (The constructor from std::basic_string
is tested separately anyway.)
2025-09-12 10:19:51 +02:00
Gennaro Prota
ba12d33c84 Don't test for Tr::eq( c, one ) twice in init_from_string() 2025-09-12 10:19:51 +02:00
Gennaro Prota
36d52d6b00 No longer use boost::move()
Reason: We require C++11 now, so we can use std::move().
2025-09-12 10:19:51 +02:00
Gennaro Prota
95e06608e1 Actually test the move constructor in the move constructor tests
We were testing the *copy* constructor, instead.
2025-09-12 10:19:51 +02:00
Gennaro Prota
21eda71789 Replace a #include of a deprecated include file 2025-09-12 10:19:51 +02:00
Gennaro Prota
8587d4f97c Remove a superfluous #include directive 2025-09-12 10:19:51 +02:00
Gennaro Prota
c442ecdc90 Add missing const qualifiers 2025-09-12 10:19:51 +02:00
Gennaro Prota
ed2f5281fe Make lowest_bit() more efficient
As a nice bonus, this also removes the dependency on Boost.Integer.
2025-09-12 10:19:51 +02:00
Gennaro Prota
fd95d1b570 Remove a spurious space 2025-09-12 10:19:51 +02:00
Gennaro Prota
a02393bd26 Fix a misleading variable name 2025-09-12 10:19:51 +02:00
Gennaro Prota
d7ba1ffd13 Get rid of BOOST_STATIC_ASSERT() and BOOST_STATIC_CONSTANT()
Reason: They are no longer necessary, given that we require C++11 now.
2025-09-12 10:19:51 +02:00
Gennaro Prota
6ef22fc69c Assert that Block is the same type as AllocatorOrContainer::value_type
Reason: That's required both when AllocatorOrContainer is an allocator
type and when it's a container type. Now, when it is an allocator type,
the assert is usually in the implementation of std::vector, which we
use. But, when it's a container type, we need to assert that on our own.
2025-09-12 10:19:51 +02:00
Gennaro Prota
6a5faf3597 Remove the parameter-less overloads of find_first() and find_first_off()
Reason: We can use a default argument, instead, which is what
dynamic_bitset usually does.
2025-09-12 10:19:51 +02:00
Gennaro Prota
399230316c Make pop_back() more efficient 2025-09-12 10:19:51 +02:00
Gennaro Prota
f997c1fa7f Back out the support for operator<=> in our iterators
Reason: It required operator<=> for the underlying container, and
boost::container::small_vector doesn't support it.
2025-09-12 10:19:51 +02:00
Gennaro Prota
969c7e0947 Make buffer_type public
Reason: Failures from GCC and Clang. See the new code comment.
2025-09-12 10:19:51 +02:00
Gennaro Prota
7668759686 Remove some outdated macros (workarounds for MSVC 6) 2025-09-12 10:19:51 +02:00
Gennaro Prota
7144965095 Remove another workaround for Codewarrior 8.3
Reason: Obsolete compiler.
2025-09-12 10:19:51 +02:00
Gennaro Prota
b0b94ec560 Add C++20 iterators
Reason: Requested on the mailing list.
2025-09-12 10:19:51 +02:00
Gennaro Prota
1f6e471132 Allow choosing the underlying container type
The user can now choose the underlying container used by dynamic_bitset.
This allows e.g. having small buffer optimization by using
boost::container::small_vector.

Since the underlying container is no longer guaranteed to be
std::vector, we revert "Reflect some noexcept specifications of
std::vector in dynamic_bitset" and the related "Let MrDocs compile the
code as C++17".

Note that we didn't add serialization tests (dyn_bitset_unit_tests5.cpp)
because boost::container::small_vector has no serialization support.

This closes issue #76.
2025-09-12 10:19:51 +02:00
Gennaro Prota
467e121a68 Add find_first_off(), find_first_off( size_type ) and find_next_off( size_type ) 2025-09-12 10:19:51 +02:00
Gennaro Prota
c12ffc8b37 Don't repeat the preprocessing condition to specialize std::hash 2025-09-12 10:19:51 +02:00
Alan de Freitas
dc2a88e9a7 Make the MrDocs documentation multipage 2025-09-12 10:19:51 +02:00
Alan de Freitas
1ead020341 Support CMake root mode 2025-09-12 10:19:51 +02:00
Gennaro Prota
0b177806ce Ensure all #includes are at the top of the source file 2025-09-12 10:19:38 +02:00
Gennaro Prota
055631591a Document our support for std::hash 2025-09-12 10:16:34 +02:00
Gennaro Prota
abbecdb56e Remove some symbol filters from mrdocs.yml
Reason: They no longer seem necessary.
2025-09-11 12:49:13 +02:00
Gennaro Prota
7a01d14918 Reword a comment using singular they 2025-09-11 12:49:13 +02:00
Gennaro Prota
9baffa4887 Document that max_size() doesn't emit exceptions 2025-09-11 12:49:13 +02:00
Gennaro Prota
baf130a7e6 Use noexcept instead of BOOST_NOEXCEPT
Reason: We require C++11 support anyway.
2025-09-11 12:49:13 +02:00
ivanpanch
9ad6687e9a Fix a typo (“slighly”) in a documentation comment 2025-09-11 12:49:13 +02:00