Commit Graph

1049 Commits

Author SHA1 Message Date
Andrey Semashev
7c9b4296a1 Fixed accessing members of the dereferenced value after iterator post-increment.
The recent commit 5777e9944b broke code such as
(*it++).foo(), where the result of dereferencing would be convertible to
the value type but did not provide the members of the value type. To mitigate
this, return a reference to the value instead of a proxy object. This will only
work for non-writable iterators (and it didn't work for writable iterators
before either) because in that case a proxy is needed to be able to intercept
operator=.

Also fix a similar issue with (it++)->foo() by adding operator-> overloads
to the post-increment result proxies.

Added tests for the fixes.
boost-1.82.0.beta1 boost-1.82.0 boost-1.81.0
2022-11-18 00:46:21 +03:00
Andrey Semashev
0a95636faf Added test for converting func_input_iter increment results to the iterator type. boost-1.81.0.beta1 2022-11-09 21:19:00 +03:00
Andrey Semashev
5777e9944b Added conversion from postfix increment proxy to iterator type.
This allows expressions such as `Iterator it2(it1++)` to compile.

Additionally separated operations that are allowed on the result of
dereferencing the proxy to a separate set of proxies to make the allowed
set of expressions more strict and unambiguous. In particular, it means
`it++` cannot be converted to value type and `*it++` cannot be converted
to the iterator type anymore. Also, make sure `*it1++ = *it2++` works
as expexted by explicitly converting the proxy to the value type on
assignment.

Fixes https://github.com/boostorg/iterator/issues/75.
2022-11-09 21:16:20 +03:00
Andrey Semashev
853ba3d3c7 Use the proper derived type of the function_input_iterator in iterator_facade.
This fixes incorrect final iterator type being used in iterator_facade, which
results in an internal base class being returned from various facade methods.

Reported in https://github.com/boostorg/iterator/issues/75.
2022-11-09 21:15:44 +03:00
Andrey Semashev
f82627f2cc Updated to GHA checkout@v3 to avoid deprecation warnings. 2022-10-18 17:57:57 +03:00
Andrey Semashev
ed1d96f251 GitHub Actions config update.
- Added gcc-12 and clang-13 through 15 jobs.
- Added C++23 testing for gcc and clang on Linux.
- Updated clang version for UBSAN job.
- Updated Ubuntu version for clang jobs to avoid having to use external APT
  repository.
- Updated python package installation for compatibility with Ubuntu 22.04.
2022-09-10 01:29:45 +03:00
Andrey Semashev
ce52aee3ce Switched gcc-9 to ubuntu-20.04 GHA CI image. 2022-08-14 17:53:43 +03:00
Andrey Semashev
17355c5ad0 Updated copyright years. 2022-08-14 14:01:45 +03:00
Andrey Semashev
9504b3bced Replaced ubuntu-18.04 GHA CI images with containers.
Also use ubuntu-latest image for jobs that are running in a container.
2022-08-14 14:00:17 +03:00
Andrey Semashev
2cc45f1694 Switch to macos-11 GHA image as macos-10.15 is deprecated. 2022-08-12 15:59:54 +03:00
Andrey Semashev
a3269e536f Include remove_reference.hpp only when needed. boost-1.80.0.beta1 boost-1.80.0 2022-07-01 00:23:19 +03:00
Andrey Semashev
129245a985 Added tests for function_output_iterator. 2022-07-01 00:14:14 +03:00
Andrey Semashev
1a80896934 Disabled assignment of output_proxy to output_proxy. 2022-07-01 00:13:32 +03:00
Andrey Semashev
ee2d3a6596 Made output_proxy private and made its internals private. 2022-06-30 23:35:58 +03:00
Andrey Semashev
cd24487161 Removed #include <utility>. 2022-06-30 23:26:52 +03:00
Andrey Semashev
dd37a27067 Marked output_proxy constructor explicit. 2022-06-30 23:25:33 +03:00
Andrey Semashev
7b6edb6a7d Merge pull request #73 from Hailios/rvalue_ref_func_iterator
add forward reference assignment operator to function_output_iterator
2022-06-30 23:24:11 +03:00
jakob lovhall
c924b42749 add forward reference assignment operator to function_output_iterator 2022-06-30 15:40:41 +02:00
Andrey Semashev
85d935bf68 Added VS2022 job and C++20 and C++latest jobs to AppVeyor CI. 2022-06-06 02:57:44 +03:00
Andrey Semashev
d175ba2450 Trim trailing spaces. boost-1.79.0.beta1 boost-1.79.0 2022-01-13 17:32:11 +03:00
Andrey Semashev
75ba1a50c9 Switched enable_if from MPL to TypeTraits. 2022-01-13 17:28:53 +03:00
Andrey Semashev
e4ab917f79 Removed unneeded includes and added missing ones to transform_iterator. 2022-01-13 17:27:22 +03:00
Andrey Semashev
c901bd6d7a Switched function_input_iterator to TypeTraits instead of MPL. 2022-01-13 17:08:55 +03:00
Andrey Semashev
eb0d01126a Added support for int128 to counting_iterator. 2022-01-13 16:59:46 +03:00
Andrey Semashev
abe6fbfd4b Converted counting_iterator to rely on TypeTraits instead of MPL. 2022-01-13 16:57:52 +03:00
Andrey Semashev
7a200905dd Added an assignment operator to counting_iterator.
This should silence gcc warnings about deprecated implicit copy assignment
operator because of the explicitly defined copy constructor. Also, changed
constructor definitions to be defaulted when possible and added missing
includes.

Closes https://github.com/boostorg/iterator/pull/69.
2022-01-13 16:34:47 +03:00
Andrey Semashev
acf35d2a87 Fixed a link to library docs and silenced b2 warning about unescaped character. boost-1.78.0 2021-11-19 18:32:24 +03:00
Andrey Semashev
5ebbe941be Updated check for apt-add-repository capabilities.
In Ubuntu 20.04 there appeared an updated version of the
software-properties-common package in focal-updates, which ships a newer
apt-add-repository version that doesn't support -P/-S/-U command line arguments.

Since we cannot rely on package version checks to determine apt-add-repository
capabilities, we have to parse its --help output instead.

Also, made source list processing more protected against spaces.
2021-11-16 00:48:57 +03:00
Andrey Semashev
72308ef787 Fixed git version check on Mac OS. boost-1.78.0.beta1 2021-09-26 20:40:21 +03:00
Andrey Semashev
9124869bcc Updated link to AppVeyor badge. 2021-09-15 22:15:48 +03:00
Andrey Semashev
216b442d23 Added GHA CI timeout. 2021-09-15 21:32:19 +03:00
Andrey Semashev
c858138495 Explicitly specify address-model for MSVC.
This works around Boost.Build bug:

https://github.com/boostorg/build/issues/659
2021-09-13 10:02:47 +03:00
Andrey Semashev
1c6f85d4f9 Fixed a preprocessor condition. 2021-09-12 23:36:59 +03:00
Andrey Semashev
0a59f555ca Added libc++ 12 to the list of standard libs implementing C++20 std::ostream_iterator. 2021-09-12 22:52:55 +03:00
Andrey Semashev
18337e990b Disable zip_iterator test with std::tuple on gcc 4.4.
libstdc++ from gcc 4.4 has a broken std::tuple that fails to compile
a constructor from a compatible tuple:

/usr/include/c++/4.4/tuple: In constructor 'std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with _UHead = std::_Head_base<0ul, const int&, false>, long unsigned int _Idx = 0ul, _Head = int]':
/usr/include/c++/4.4/tuple:179:   instantiated from 'std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _UElements ...>&&) [with _UElements = const int&, double&, long unsigned int _Idx = 0ul, _Head = int, _Tail = double]'
/usr/include/c++/4.4/tuple:338:   instantiated from 'std::tuple<_T1, _T2>::tuple(std::tuple<_U1, _U2>&&) [with _U1 = const int&, _U2 = double&, _T1 = int, _T2 = double]'
libs/iterator/test/detail/zip_iterator_test_original.ipp:137:   instantiated from here
/usr/include/c++/4.4/tuple:94: error: cannot convert 'std::_Head_base<0ul, const int&, false>' to 'int' in initialization
2021-09-12 22:40:19 +03:00
Andrey Semashev
1447c566d1 Removed CMake tests from GHA config. 2021-09-12 20:35:29 +03:00
Andrey Semashev
fc281fa58a Added a README.md file. 2021-09-12 20:10:07 +03:00
Andrey Semashev
b76c273946 Added GitHub Actions config. 2021-09-12 20:01:33 +03:00
Andrey Semashev
f396a8fef0 Removed Travis CI config.
Since Travis CI no longer runs free jobs for open source projects,
we are switching to GitHub Actions instead.
2021-09-12 19:59:52 +03:00
Andrey Semashev
5a6013e21f Merge pull request #67 from joaquintides/patch-2
supressed spurious type-limits warning
2021-08-31 20:36:32 +03:00
joaquintides
6dfb175cef supressed spurious type-limits warning
See https://github.com/boostorg/iterator/pull/66 for details.
2021-08-31 19:19:57 +02:00
Peter Dimov
72a7fb1b73 Update CMakeLists.txt boost-1.77.0.beta1 boost-1.77.0 2021-06-10 00:56:31 +03:00
Glen Fernandes
f4b47fd266 Switch from deprecated test to Lightweight Test 2021-06-07 22:03:32 -04:00
Andrey Semashev
2c0145bff0 [skip ci] Merge pull request #63 from eldiener/develop
[skip ci] Add "cxxstd" json field
boost-1.76.0.beta1 boost-1.76.0
2021-01-20 11:28:41 +03:00
Edward Diener
987151dde6 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-19 23:19:27 -05:00
Andrey Semashev
8e457e716b Merge pull request #60 from CaseyCarter/patch-1
MSVC also has C++20 ostream_iterator
boost-1.75.0.beta1 boost-1.75.0
2020-10-14 12:15:55 +03:00
Casey Carter
32f4f4d086 MSVC also has C++20 output_iterator
Tell iterator_traits_test not to fail on MSVC when `std::output_iterator` has `difference_type` of `std::ptrdiff_t`.
2020-10-13 19:23:49 -07:00
Andrey Semashev
72f0ebe8d0 Adjusted the check for C++20 on gcc 10.
The compiler defines __cplusplus to a non-standard value less than 202002
in C++20 mode.
boost-1.74.0 boost-1.74.0.beta1
2020-05-24 00:29:51 +03:00
Andrey Semashev
d7ad43a925 Updated to support C++20 ostream_iterator::difference_type on gcc 10. 2020-05-23 19:57:54 +03:00
Andrey Semashev
733c0fb9cb Added gcc 10 build jobs to Travis CI. 2020-05-22 18:41:15 +03:00