1147 Commits

Author SHA1 Message Date
Andrey Semashev 0316628863 Reformat and simplify code. 2026-06-21 18:15:19 +03:00
Jeremy W. Murphy 286c9885d6 Constrain distance function using is_iterator type trait (#96)
* Constrain distance function using is_iterator type trait

* Add enable_if include

* Fix template syntax in distance function

* Fix syntax issue in distance enable_if

* Test which overload of distance is called

Added a test for custom distance function using Foo struct.

* Fix wrong spelling of std::ptrdiff_t

* Move Foo struct to global scope

* Andrey magic

* Fix headers, add copyright

* Constrain advance to iterators

* Test contraint of advance function with int overload

Added overload for advance function to handle integers.

* Fix enable_if condition for advance function

* Fix template syntax in advance constraint

* Fix advance test

* Remove constexpr specifier

* Make advance overload require conversion in parameter

* Explain choice of type long for n parameter
2026-06-21 18:04:10 +03:00
Andrey Semashev 4dcba468e2 Add is_*_iterator_v variable templates in C++14 and later. 2026-05-13 12:16:22 +03:00
Andrey Semashev b74b553482 Use c++23 in macos-15 GitHub Actions. boost-1.91.0.beta1 boost-1.91.0 2025-12-13 20:42:38 +03:00
Andrey Semashev 2a4dbd1d8d Removed macos-13 GitHub Actions CI job.
The macos-13 image is deprecated by GitHub Actions and will be removed.

Refs https://github.com/actions/runner-images/issues/13046.
boost-1.90.0
2025-11-26 01:27:27 +03:00
Andrey Semashev e16399b613 Update cxxstd to 11.
Since Boost 1.88.0, the library has been reworked and now requires C++11.

Closes https://github.com/boostorg/iterator/issues/95.
2025-11-25 23:27:52 +03:00
Andrey Semashev ecf4ed8bf5 Updated AppVeyor CI clang-cl job to Visual Studio 2019 image.
clang-cl 9.0.1 from VS2017 fails because of <atomic> compilation errors
caused by Boost.SmartPtr. The maintainer considers this compiler unsupported.

Refs https://github.com/boostorg/smart_ptr/issues/120.
2025-11-14 03:49:34 +03:00
Andrey Semashev 248494330d Merge pull request #94 from Flamefire/test-link-update
Update Link to regression test matrix in README
boost-1.90.0.beta1
2025-08-25 19:05:54 +03:00
Alexander Grund ca0e772d2a Update Link to regression test matrix in README 2025-08-25 17:26:25 +02:00
Andrey Semashev 2a0b753691 Use Azure mirrors of Ubuntu .deb repositories in containers.
This reduces the likelihood of spurious CI failures caused by DDoS filters
being triggered by massive numbers of concurrent CI jobs.
boost-1.89.0
2025-06-13 03:48:03 +03:00
Andrey Semashev 0087a426d9 Added new gcc and clang jobs to GitHub Actions. 2025-06-13 03:47:38 +03:00
Andrey Semashev c409288ff5 Removed windows-2019 GitHub Actions jobs.
The windows-2019 image is deprecated and is about to be removed.
2025-06-13 03:45:12 +03:00
Andrey Semashev 01ac4e1a47 Disable operator_brackets_proxy assignment if reference is not assignable.
Use SFINAE to disable operator_brackets_proxy assignment operator is reference
is not assignable from the assignment argument. Also fix the iterator type
in std::declval in noexcept specification.
2025-06-09 12:01:39 +03:00
Andrey Semashev e968c3312b Forward dereferencing operators in operator_brackets_proxy.
This allows for expressions like it[n]->foo() and (*it[n]).foo() to compile.
2025-06-09 04:58:45 +03:00
Andrey Semashev da00617e56 Use perfect forwarding in assignment to operator_brackets_proxy.
Also apply noexcept markup to all of the proxy operators.
2025-06-09 04:58:27 +03:00
Andrey Semashev 7c77e52509 Always use operator_brackets_proxy in iterator_facade.
This avoids returning a copy of the value from operator[], which can
be unexpected by users wanting to obtain an address of the value
referenced by the iterator.

We still want to return a proxy instead of the iterator's reference
since the iterator may be holding the value internally, and the iterator
gets destroyed after returning from operator[], so the returned
reference would be dangling.

Closes https://github.com/boostorg/iterator/issues/61.
2025-06-09 03:22:08 +03:00
Andrey Semashev 256004a446 Remove gcc 4.8 and 4.9 GitHub Actions jobs.
These compilers don't provide std::is_trivially_copyable type trait,
which is now required.
2025-06-09 02:53:18 +03:00
Andrey Semashev 7e3e9a584e Replace is_copy_constructible+is_trivial with is_trivially_copyable.
For the purpose of selecting operator[] result type, we don't care
whether the value type is trivially default-constructible. So, in order
to avoid using the deprecated in C++26 is_trivial, use is_trivially_copyable
instead of is_copy_constructible+is_trivial.

Closes https://github.com/boostorg/iterator/issues/93.
2025-06-09 02:36:26 +03:00
Andrey Semashev 3767696513 Removed legacy MinGW32 AppVeyor CI job.
Boost.Regex develop no longer builds on legacy MinGW32 due to missing
definitions of std::mutex etc.
2025-05-25 03:57:17 +03:00
Andrey Semashev 1372e9afb6 Fix filter_iterator copy/converting constructor.
The constructed iterator would have an invalid end iterator because of
a typo in storage initialization.

Fixes https://github.com/boostorg/iterator/issues/92.
2025-05-24 23:19:45 +03:00
Andrey Semashev 6428e552e4 Nonessential. 2025-04-23 02:55:50 +03:00
Andrey Semashev 766c881f9a Removed usage of obsolete ubuntu-20.04 GHA image. 2025-04-19 18:36:04 +03:00
Andrey Semashev c2b846c57d Added a test for filter_iterator converting constructor. boost-1.88.0 2025-04-02 00:13:07 +03:00
Andrey Semashev 1a7996ebd0 Fixed compilation of filter_iterator conversion constructor.
The constructor would attempt to access a private member of the source
iterator, which could have a different type and therefore have that
member inaccessible. Also, the storage forwarding constructor had incorrect
types used in the forwarding expressions, which caused further compilation
errors.

Fixes https://github.com/boostorg/iterator/issues/90.
2025-04-02 00:09:36 +03:00
Andrey Semashev eee670608e Revert "Added a workaround for the missing MPL includes in Range."
This reverts commit dfb1fd9bed.

The missing includes were added to Boost.Range, the workaround is
no longer needed.
boost-1.88.0.beta1
2025-02-07 14:10:12 +03:00
Andrey Semashev c89e2b325a Removed use of std::unary_function from docs example. 2025-02-07 13:46:19 +03:00
Andrey Semashev a7150173ed Moved shared_container_iterator.hpp in iterator directory, modernized code.
shared_container_iterator now uses std::shared_ptr to store the reference
to the container. boost::shared_ptr is still supported and is wrapped
into std::shared_ptr on construction, so there is overhead due to allocation
of std::shared_ptr state. Going forward, std::shared_ptr is expected
to be the primary use case. As a bonus, this eliminates the dependency
on Boost.SmartPtr.

Moved shared_container_iterator.hpp into the iterator directory and left
a forwarding header for backward compatibility.
2025-02-07 13:36:40 +03:00
Andrey Semashev e446c6e05c Added indirect_reference_t alias. 2025-02-07 13:36:40 +03:00
Andrey Semashev 8998179e9d Added pointee_t alias. 2025-02-07 13:36:40 +03:00
Andrey Semashev d35869cd25 Moved generator_iterator.hpp in iterator directory and modernized.
generator_iterator now uses decltype approach to deduce value and reference
types instead of the legacy result_type typedef, which was required to be
defined by the generator function.

The default constructor of generator_iterator now value initializes its
data members to avoid using uninitialized data.
2025-02-07 13:36:33 +03:00
Andrey Semashev 6e6def930f Modernized transform_iterator.hpp, use EBO to store the transform function. 2025-02-07 01:17:55 +03:00
Andrey Semashev 1a58ca89d1 Reformatted reverse_iterator.hpp. 2025-02-07 01:17:55 +03:00
Andrey Semashev 34f703cfb6 Removed workarounds for older compilers from permutation_iterator.hpp. 2025-02-07 01:17:55 +03:00
Andrey Semashev a91fc06bb4 Prohibit default construction of function_output_iterator on function pointers.
Default-constructed function_output_iterator with function pointers is unusable
and previously would have contained an uninitialized function pointer.
Disable the default constructor using SFINAE to prevent misuse.

Also reformat code.
2025-02-07 01:17:55 +03:00
Andrey Semashev fd1445140f Removed usage of FunctionTypes in function_input_iterator.hpp.
This effectively removes usage of MPL in function_input_iterator.hpp and
also simplifies implementation.
2025-02-07 01:17:50 +03:00
Andrey Semashev 8c2fdf6053 Use variadic template expansion in min category deduction in zip_iterator.
This results in marginally faster compile times in modern code bases
where tuples are variadic.
2025-02-06 01:47:49 +03:00
Andrey Semashev aadd90df45 Removed direct usage of MPL from zip_iterator.hpp.
MPL is still used through Boost.Fusion, but that is a matter of
optimizing Boost.Fusion now.
2025-02-06 01:47:49 +03:00
Andrey Semashev dc57bcf319 Modernized filter_iterator.hpp.
Use EBO to minimize wasted storage space if the predicate is an empty class.

Disable default constructing non-class predicates using SFINAE instead
of a static_assert. This will help type traits like is_constructible,
when applied to the iterator type.
2025-02-06 01:47:49 +03:00
Andrey Semashev baf6d06cc2 Modernized iterator_traits.hpp.
Added *_t type traits and removed an oudated macro that was used with
ancient compilers.
2025-02-06 01:47:49 +03:00
Andrey Semashev 6e60ea7a88 Extracted and unified default template parameter handling helpers.
The new eval_if_default helper replaces both ia_dflt_help and
ia_eval_if_default helpers. Additionally, added a new if_default
helper, which expands to the type or the default parameter directly.

The new helpers are placed in separate headers which can be used
without the iterator_adaptor template.
2025-02-06 01:47:43 +03:00
Andrey Semashev cb81a1dfc3 Extracted enable_if_convertible trait to a separate header.
Keep including the new header in iterator_adaptor.hpp for backward
compatibility, until downstream users are updated to include the new
header.
2025-02-06 01:38:24 +03:00
Andrey Semashev c22af90b60 Reformat advance.hpp and distance.hpp. 2025-02-06 01:38:24 +03:00
Andrey Semashev b6a41e325c Added a missing include in interoperable.hpp. 2025-02-06 01:38:24 +03:00
Andrey Semashev 0c2eda4bb8 Removed MPL usage from indirect_iterator.hpp. 2025-02-06 01:38:16 +03:00
Andrey Semashev dfb1fd9bed Added a workaround for the missing MPL includes in Range.
This is a temporary workaround until Boost.Range is fixed by:

https://github.com/boostorg/range/pull/154
2025-02-05 18:51:44 +03:00
Andrey Semashev b12874b6ca Removed MPL usage from iterator_facade.hpp. 2025-02-05 18:51:44 +03:00
Andrey Semashev 1875d95019 Removed MPL usage from iterator_adaptor.hpp. 2025-02-05 18:51:44 +03:00
Andrey Semashev 4f5f61e37b Slightly optimized iterator_facade_default_category compilation speed. 2025-02-05 18:51:44 +03:00
Andrey Semashev 5aa1c9fef3 Removed workarounds for older compilers from is_readable_iterator.hpp. 2025-02-05 18:51:44 +03:00
Andrey Semashev d6a68dc6eb Removed workarounds for older compilers from counting_iterator.hpp. 2025-02-05 18:51:44 +03:00