46 Commits

Author SHA1 Message Date
Gennaro Prota
54c841d585 Exercise subtraction between iterators in the unit tests
Reason: This was missing. And we forgot a friend declaration for the
corresponding operator-(), which will be added with the next commit.
2025-12-22 11:53:06 +01:00
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
796fcb615b Add more tests for reverse iterators 2025-10-15 11:41:44 +02:00
Gennaro Prota
6b5e49ea40 Assume locales and std::use_facet() are always available
I think the days we needed to cope with their absence are gone.
2025-10-15 11:41:44 +02:00
Gennaro Prota
bd00ce2e58 Reuse nth_bit() in bitset_test::append_block() 2025-10-15 11:41:43 +02:00
Gennaro Prota
f3d7d5c960 Improve the resize() tests 2025-10-15 11:41:43 +02:00
Gennaro Prota
63716d84a3 Clean up the swap() tests
Note that we still stated that references must be stable under a swap,
which is no longer true after "Allow choosing the underlying container
type".
2025-10-15 11:41:43 +02:00
Gennaro Prota
286e721430 Shorten a condition in the tests of max_size() 2025-10-15 11:41:43 +02:00
Gennaro Prota
7aca0a80fd Remove an erroneous comment 2025-10-15 11:41:43 +02:00
Gennaro Prota
cd68ee4632 Remove two useless comments 2025-10-15 11:41:43 +02:00
Gennaro Prota
f637b5bab1 Remove some special test code for the Dinkumware stdlib of MSVC 6
Reason: MSVC 6 is no longer supported.
2025-10-15 11:41:43 +02:00
Gennaro Prota
57bdff3f12 Remove an erroneous comment 2025-10-15 11:41:43 +02:00
Gennaro Prota
5a25945ed7 Remove superfluous parentheses in a return statement 2025-10-15 11:41:43 +02:00
Gennaro Prota
7755190288 Improve the tests of operator!=() 2025-10-15 11:41:43 +02:00
Gennaro Prota
b52e7cd97b Improve the flip() tests 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
6f3634aa4b Remove the dependency on core/allocator_access.hpp 2025-10-15 11:41:43 +02:00
Gennaro Prota
d8365ee015 Make the max_size() tests a bit more meaningful 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
bb489c186a 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-10-15 11:41:43 +02:00
Gennaro Prota
e00d9b30ae No longer use boost::move()
Reason: We require C++11 now, so we can use std::move().
2025-10-15 11:41:43 +02:00
Gennaro Prota
ae9703b119 Actually test the move constructor in the move constructor tests
We were testing the *copy* constructor, instead.
2025-10-15 11:41:43 +02:00
Gennaro Prota
12dfcea22f Get rid of BOOST_STATIC_ASSERT() and BOOST_STATIC_CONSTANT()
Reason: They are no longer necessary, given that we require C++11 now.
2025-10-15 11:41:43 +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
e194055264 Add find_first_off(), find_first_off( size_type ) and find_next_off( size_type ) 2025-10-14 19:24:47 +02:00
Gennaro Prota
d63c03ceb2 Leave inline to the compiler 2025-10-14 19:24:46 +02:00
Gennaro Prota
d839f23916 Make scoped_temp_file non-copyable, as it should 2025-10-14 19:24:46 +02:00
Gennaro Prota
963cc09f3c Remove a nonsensical typedef 2025-10-14 19:24:46 +02:00
Gennaro Prota
12acc40123 Reformat all the C++ code (with ClangFormat) 2025-10-14 19:24:45 +02:00
Gennaro Prota
c6709f3c74 Add a missing const qualifier in a test function 2025-10-14 19:24:45 +02:00
Gennaro Prota
e8d9288620 Remove other workarounds for obsolete compilers 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
Gennaro Prota
2852d27363 Remove all support for pre-standard iostreams
Reason: When I re-implemented dynamic_bitset, GCC 2.95 was still around
and its library still only implemented pre-standard iostreams, so I
added that support. But I'm pretty sure no one needs it, now.
2025-07-07 15:29:13 +02:00
twomice
34f55c74b1 Implement find_first(pos). 2024-11-26 13:59:18 -05:00
akr
29e1d40e88 Added std::out_of_range tests 2022-05-02 20:38:40 -04:00
akr
12be4b4464 Added tests 2022-05-02 20:38:40 -04:00
Edward Diener
ffff25ac00 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. (#54) 2020-04-16 07:47:58 -07:00
Glen Fernandes
ccb380a1bc Switch from deprecated Test to LightweightTest 2019-06-07 07:02:31 -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
7b6379a356 Add CI framework used in a number of other repositories:
- travis with valgrind, cppcheck, ubsan, codecov, covscan (future)
  - appveyor with MSVC 2010 through 2017, cygwin 32/64, mingw 32/64
  - README, LICENSE, etc.
2018-07-04 07:49:11 -04: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
Daniel
d86f4ebddb Move tests into test subdirectory 2016-07-01 09:08:51 +01:00