21 Commits

Author SHA1 Message Date
Gennaro Prota
41799d3fe5 Take into account that the underlying container is not necessarily a std::vector in max_size()
The vector_max_size_workaround() we had in place, and one of the test
cases, only considered std::vectors, which are no longer the only
allowed containers. This commit fixes "Allow choosing the underlying
container type".
2025-10-15 11:41:44 +02:00
Gennaro Prota
c9964a771b Use the typename keyword for the template parameter of minimal_allocator
Reason: Consistency.
2025-10-15 11:41:44 +02:00
Gennaro Prota
7a00f3c051 No longer condition the use of (unsigned) long long on BOOST_HAS_LONG_LONG
Reason: We require C++11.
2025-10-15 11:41:43 +02:00
Gennaro Prota
134fab263b Add a missing #include directive 2025-10-15 11:41:43 +02:00
Gennaro Prota
4cf19a2b0a Fix append< BlockInputIterator >() for input iterators
We were using `AllocatorOrContainer` as if it were still guaranteed to
be an allocator type. Unfortunately, the append() tests didn't exercise
input iterators, so this went unnoticed. I've now added tests.
2025-10-15 11:41:43 +02:00
Gennaro Prota
4ca26518ec Add a missing comment 2025-10-15 11:41:43 +02:00
Gennaro Prota
8f07dd356a Add push_front() and pop_front() 2025-10-15 11:41:43 +02:00
Gennaro Prota
efd4d41f60 No longer use BOOST_NO_CXX11_RVALUE_REFERENCES
Reason: We require decent C++11 support anyway.
2025-10-15 11:41:43 +02:00
Gennaro Prota
0177f4adfa 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-10-15 11:41:43 +02:00
Gennaro Prota
6747f81566 Remove some outdated macros (workarounds for MSVC 6) 2025-10-15 11:41:42 +02:00
Gennaro Prota
b428ca6365 Remove another workaround for CodeWarrior
Reason: Obsolete compiler.
2025-10-15 11:41:14 +02:00
Gennaro Prota
35b0094529 Add C++20 iterators
Reason: Requested on the mailing list.
2025-10-14 19:24:47 +02:00
Gennaro Prota
1b8ef09564 Allow choosing the underlying container type
The user can now choose the underlying container type 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-10-14 19:24:47 +02:00
Gennaro Prota
12acc40123 Reformat all the C++ code (with ClangFormat) 2025-10-14 19:24:45 +02:00
Gennaro Prota
599cc67e9d Remove trailing whitespace 2025-10-14 19:24:45 +02:00
Gennaro Prota
e00b0048f9 Clean up all the #include sections
This commit:

- Sorts the #include directives: The #includes of the ""-form come
  first, those of the <>-form come later (this helps checking if any
  include file is not self-sufficient); in each of the two groups, the
  names of the headers or source files are sorted alphabetically (this
  eases searching for a specific #include and avoids duplicates).

- Uses the ""-form when including Boost files; using the <>-form is a
  relic of the past. This was even discussed on the developers list many
  years ago and led to core issue 370. Note that some parts of
  DynamicBitset were already using the ""-form and that has never caused
  any problem, AFAIK.

- Removes some comments attached to the directives themselves which
  seemed pretty useless and prone to get out of sync.
2025-09-11 12:31:09 +02:00
akr
12be4b4464 Added tests 2022-05-02 20:38:40 -04:00
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
Glen Fernandes
ccb380a1bc Switch from deprecated Test to LightweightTest 2019-06-07 07:02:31 -04:00
Glen Fernandes
d7d6555f85 Correct e-mail address 2018-09-05 08:11:50 -04:00
Daniel
d86f4ebddb Move tests into test subdirectory 2016-07-01 09:08:51 +01:00